1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- 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
- })
- ]
- }
- }
|