text: // const webpack = require('webpack')
  const path = require('path')
  
  module.exports = {
    publicPath: './',
    assetsDir: './static',
    productionSourceMap: false,
    lintOnSave: true, // 是否开启eslint
    // 它支持webPack-dev-server的所有选项
    devServer: {
      host: 'localhost', // 也可以直接写IP地址这样方便真机测试
      port: 2001, // 端口号
      https: false, // https:{type:Boolean}
      open: true // 配置自动启动浏览器
    },
    configureWebpack: (config) => {
      return {
        module: {
          unknownContextCritical: false,
          rules: [
            {
              test: /\.js$/,
              enforce: 'pre',
              sideEffects: false
            }
          ]
        },
        optimization: {
          usedExports: true,
          splitChunks: {
            maxInitialRequests: Infinity,
            minSize: 0,
            maxSize: 250000,
            cacheGroups: {
              vendor: {
                test: /[\\/]node_modules[\\/]/,
                priority: -10,
                chunks: 'all',
                name(module) {
                  const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]
                  return `npm.${packageName.replace('@', '')}`
                }
              }
            }
          }
        },
        output: {
          sourcePrefix: ' '
        },
        amd: {
          toUrlUndefined: true
        },
        resolve: {
          alias: {
            vue$: 'vue/dist/vue.esm.js',
            '@': path.resolve('src')
          }
        },
        node: {
          fs: 'empty',
          Buffer: false,
          http: 'empty',
          https: 'empty',
          zlib: 'empty'
        }
      }
    }
  }
  