// webpack.config.js
const easywebpack = require('easywebpack-html');
const webpack = easywebpack.webpack;
const merge = easywebpack.merge;
const env = process.env.BUILD_ENV;
const baseWebpackConfig = easywebpack.getWebpackConfig({
env, // 根据环境变量生成对应配置,可以在 npm script 里面配置,支持dev, test, prod 模式
entry: 'src/page',
template: 'src/view/layout.html', // html 模板
loaders: {
eslint: false // 举例
},
plugins:{
imagemini: false // 举例
}
});
// 拿到基础配置, 可以进行二次加工
const webpackConfig = merge(baseWebpackConfig, {
// 自定义配置
})
module.exports = webpackConfig;