Generate common used webpack config with builtin configs.
Loaders are not listed
Only show options
Generate a preview-only config file at
process.cwd() + 'webpack.config.preview.only.js';
copy-webpack-plugin
webpack-build-notifier
stylelint-webpack-plugin
workbox-webpack-plugin
use cli
node bin/index.js [--option]
# this will generate preview with all configs in production mode
node bin/index.js
# this only show available options
node bin/index.js --help
# enable vue support
node bin/index.js --vue
in webpack.config.js
const { CMD, CLI, generateConfig } = require('generate-config');
const config = generateConfig(
{
...CMD, // this will enable all builtin configs
'enable-preview': CLI['enable-preview'], // this will generate a preview file
},
process.env.NODE_ENV
);
module.exports = config;
Some configs not listed here may be automatically applied. (like postcss and some env dependant configs)