const UglifyJsPlugin = require('uglifyjs-webpack-plugin') module.exports = { 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: './', // 打包后引用的资源路径 configureWebpack: { plugins: [ //打包环境去掉console.log new UglifyJsPlugin({ uglifyOptions: { compress: { drop_console: true, //注释console drop_debugger: true, //注释debugger pure_funcs: ['console.log'], //移除console.log }, }, }), ], } }