const CompressionWebpackPlugin = require('compression-webpack-plugin'); // 开启压缩 const webpack = require('webpack'); // const isProduction = process.env.NODE_ENV === 'production'; module.exports = { publicPath: './', productionSourceMap: false, devServer: { port: 8081, proxy: { '/test/face': { target: 'https://facegame.platomix.net', pathRewrite: { '^/test/face': '/' } }, }, }, pages: { mobile: { entry: 'src/mobile.js', template: 'public/mobile.html', filename: 'mobile.html' }, index: { entry: 'src/main.js', template: 'public/index.html', filename: 'index.html' }, }, chainWebpack: config => { config.plugins.delete('prefetch') }, css: { loaderOptions: { css: {}, postcss: { plugins: [ require('postcss-plugin-px2rem')({ rootValue: 75, exclude: /(node_module)/, }), ] }, sass: { prependData: `@import "./src/styles/mixin.scss";` } } }, configureWebpack: { // 服务器也要相应开启gzip plugins: [ new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 30, minChunkSize: 1000 }) ] } }