ecma-webpack-plugin
Verify your wepback output code is compliant to the ECMAScript version you're targeting.
This is useful for cases when you want to be sure your babel options get you covered and especially if you exclude node modules directory like the official babel recommendation (I mean, why would you exclude the packages you don't control?).
Example webpack.config.js
const EcmaPlugin = require('ecma-webpack-plugin');
module.exports = {
// ...
plugins: [
// ...,
new EcmaPlugin({ parser: { ecmaVersion: '5' } })
]
};
Options:
Options | Meaning | defaults |
---|---|---|
parser | Parser options (Acorn) | Acorn defaults |
extensions | File extensions to verify | ['js', 'mjs'] |