Merge branch 'build' of http://git.sinoecare.com/sinoecare/digital_village_v2/dvcp_v2_webapp into build
This commit is contained in:
@@ -21,7 +21,8 @@ module.exports = {
|
||||
chainWebpack: (config) => {
|
||||
config.module
|
||||
.rule('js')
|
||||
.include.add(path.resolve(__dirname, 'packages'))
|
||||
.include
|
||||
.add(path.resolve(__dirname, 'packages'))
|
||||
.add(path.resolve(__dirname, 'components'))
|
||||
.add(path.resolve(__dirname, 'project'))
|
||||
.add(path.resolve(__dirname, 'examples'))
|
||||
@@ -29,25 +30,7 @@ module.exports = {
|
||||
.end()
|
||||
.use('babel')
|
||||
.loader('babel-loader')
|
||||
.tap((options) => options);
|
||||
if (process.env.NODE_ENV == 'production') {
|
||||
//生产环境,打包压缩js
|
||||
config.plugin('uglifyjs-plugin').use('uglifyjs-webpack-plugin', [
|
||||
{
|
||||
include: /\/(packages|subPackages|core)/,
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
drop_debugger: true, // console
|
||||
drop_console: true,
|
||||
pure_funcs: ['console.log'] // 移除console
|
||||
},
|
||||
warnings: false
|
||||
},
|
||||
sourceMap: false,
|
||||
parallel: true
|
||||
}
|
||||
]);
|
||||
}
|
||||
.tap(options => options);
|
||||
},
|
||||
devServer: {
|
||||
host: '0.0.0.0', //主机地址
|
||||
|
||||
Reference in New Issue
Block a user