module.exports = {
  configureWebpack: {
    optimization: {
      splitChunks: {
        cacheGroups: {
          vendors: {
            name: 'chunk-vendors',
            test: /[\\/]node_modules[\\/]/,
            priority: -10,
            chunks: 'initial',
            minChunks: 2 // 至少被引用2次才提取
          },
          common: {
            name: 'chunk-common',
            minChunks: 2,
            priority: -20,
            chunks: 'initial',
            reuseExistingChunk: true
          }
        }
      }
    }
  },
  productionSourceMap: false, // 关闭source map
  css: {
    extract: true, // 提取CSS
    sourceMap: false,
    loaderOptions: {
      sass: {
        implementation: require('sass') // 使用dart-sass
      }
    }
  }
}