1.0.3 • Published 1 year ago

@pieced/js-config-webpack-plugin v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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

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,
    },
  },
}