@pieced/js-config-webpack-plugin
v1.0.3
Published
Automatically configuration webpack5 js loader
Downloads
2
Readme
Automatically configuration webpack5 js loader
Install
npm i --save-dev @pieced/js-config-webpack-plugin
Webpack Config
const JsConfigWebpackPlugin = require('@pieced/js-config-webpack-plugin');
module.exports = {
plugins: [new JsConfigWebpackPlugin()],
};
Options
suffix
type array
default ['js', 'jsx', 'mjs']
filename
type string function (pathData, assetInfo) => string
- output.filename
- default
webpack.mode === 'development' ? '[name].js' : 'static/js/[contenthash:10].js'
chunkFilename
type string function (pathData, assetInfo) => string
- output.chunkFilename
- default
webpack.mode === 'development' ? '[name].js' : 'static/js/[contenthash:10].js'
terser
type object
- terser-webpack-plugin options
- default
const defaultTerser = {
extractComments: false,
terserOptions: {
output: {
comments: false,
},
compress: {
drop_debugger: true,
drop_console: true,
},
},
}