|
|
@@ -0,0 +1,74 @@ |
|
|
|
// const UglifyJsPlugin = require('uglifyjs-webpack-plugin') |
|
|
|
const path = require('path'); |
|
|
|
module.exports = { |
|
|
|
configureWebpack: { |
|
|
|
resolve: { |
|
|
|
alias: { |
|
|
|
'@': path.resolve(__dirname, 'src') |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
css: { |
|
|
|
loaderOptions: { |
|
|
|
css: { |
|
|
|
// options here will be passed to css-loader |
|
|
|
}, |
|
|
|
// postcss: { |
|
|
|
// // options here will be passed to postcss-loader |
|
|
|
// plugins: [require('postcss-px2rem')({ |
|
|
|
// remUnit: 75 |
|
|
|
// })] |
|
|
|
// } |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
pwa: { |
|
|
|
iconPaths: { |
|
|
|
favicon32: 'favicon.ico', |
|
|
|
favicon16: 'favicon.ico', |
|
|
|
appleTouchIcon: 'favicon.ico', |
|
|
|
maskIcon: 'favicon.ico', |
|
|
|
msTileImage: 'favicon.ico' |
|
|
|
} |
|
|
|
}, |
|
|
|
//http://www.metavatar.cc/ |
|
|
|
devServer: { |
|
|
|
overlay: { |
|
|
|
warnings: false, |
|
|
|
errors: false |
|
|
|
}, |
|
|
|
proxy: { |
|
|
|
'/api': { |
|
|
|
target: 'https://smapitestmalls,iformall.com/C/api', |
|
|
|
changeOrigin: true, |
|
|
|
pathRewrite: { |
|
|
|
'^/api': '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
lintOnSave: false, |
|
|
|
publicPath: './', // 打包后引用的资源路径 |
|
|
|
|
|
|
|
chainWebpack: config => { |
|
|
|
config.plugin('html').tap(args => { |
|
|
|
args[0].favicon = './public/favicon.ico'; |
|
|
|
return args; |
|
|
|
}); |
|
|
|
} |
|
|
|
// configureWebpack: { |
|
|
|
// plugins: [ |
|
|
|
// //打包环境去掉console.log |
|
|
|
// new UglifyJsPlugin({ |
|
|
|
// uglifyOptions: { |
|
|
|
// compress: { |
|
|
|
// drop_console: true, //注释console |
|
|
|
// drop_debugger: true, //注释debugger |
|
|
|
// pure_funcs: ['console.log'], //移除console.log |
|
|
|
// }, |
|
|
|
// }, |
|
|
|
// }), |
|
|
|
// ], |
|
|
|
// } |
|
|
|
} |