npm.io
1.1.18 • Published 1 year ago

@pieced/js-config-webpack-plugin

Licence
MIT
Version
1.1.18
Deps
9
Size
9 kB
Vulns
0
Weekly
0

@pieced/js-config-webpack-plugin

Version Download Webpack Last Commit License: MIT

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

webpack.mode === 'development' ? '[name].js' : 'static/js/[contenthash:10].js'

terser

const defaultTerser = {
  extractComments: false,
  terserOptions: {
    output: {
      comments: false,
    },
    compress: {
      drop_debugger: true,
      drop_console: true,
    },
  },
}

Keywords