标签:代码 option 添加 常见 指定 html模板 slist test ons
module.exports = { entry: ‘./src/index.js‘, output: { filename: ‘main.js‘, path: path.resolve(__dirname, ‘dist‘), publicPath: ‘dist/‘ } }
plugins: [ new htmlWebpackPlugin({ filename: ‘index.html‘, template: ‘./index.html‘, inject: ‘body‘, chunks: [‘one‘], minify: { removeComments: true, removeAttributeQuotes: true } }) ]
{ test: /\.js$/, exclude: /node_modules/, use: { loader: ‘babel-loader‘, options: { presets: [‘@babel/preset-env‘] } } }
module: { rules: [ { test: /\.scss$/, use: [ ‘style-loader‘, ‘css-loader‘, ‘sass-loader‘, { loader: ‘postcss-loader‘, options: { plugins: [ autoprefixer({ overrideBrowserslist: [‘last 10 versions‘] }) ] } }, ] }, ] }
webpack执行命令可以携带的参数
使用实例:webpack --progres --colors --xxx
标签:代码 option 添加 常见 指定 html模板 slist test ons
原文地址:https://www.cnblogs.com/longlongdan/p/10945192.html