Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JoviDeCroock/webpack-syntax-resolver-plugin
A resolver that respects the syntax field proposal
https://github.com/JoviDeCroock/webpack-syntax-resolver-plugin
Last synced: 3 months ago
JSON representation
A resolver that respects the syntax field proposal
- Host: GitHub
- URL: https://github.com/JoviDeCroock/webpack-syntax-resolver-plugin
- Owner: JoviDeCroock
- Created: 2019-03-16T08:44:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-22T18:19:53.000Z (almost 2 years ago)
- Last Synced: 2024-07-20T04:26:17.532Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 313 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
Awesome Lists containing this project
README
# Webpack Syntax Resolver Plugin
[![npm version](https://badge.fury.io/js/webpack-syntax-resolver-plugin.svg)](https://badge.fury.io/js/webpack-syntax-resolver-plugin)
## Why
> Do not use this, this was a reaction to a proposal made for syntax fields on the package json field which allowed package authors to specify
> newer versions of the ECMA spec for their distributed filesThis automates resolving the plugin on a more modern syntax field, this field
is derived from the package.json.Example: pkg X would normally be imported as an ES5 module, this plugin sees
that pkg X exports a more modern ES6 bundle because syntax.esmodule leads
to that bundle.
Then this package will rewrite this resolver call to use the modern lib
instead.Caution: not all browsers support ES6 features, this lib is intended to be
used with a [module nomodule build](https://github.com/JoviDeCroock/webpack-module-nomodule-plugin)## How to use
```javascript
const syntaxResolverPlugin = require('webpack-syntax-resolver-plugin');{
...webpackConfig,
resolve: {
plugins: [new syntaxResolverPlugin()],
},
}```
And let it to the magic, if you find a package that is causing issues you
can ignore it by passing an option to this plugin named: ignoredModules,
this expects an array.The rest will be handled for you!
## Example
https://github.com/JoviDeCroock/POC-ModularLegacyBuild
## Installation
`npm install --save-dev webpack-syntax-resolver-plugin`