config的配置

本文详细探讨了Vue.js项目中config的配置,包括各种关键设置及其影响,帮助开发者更好地理解和定制项目构建过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

config的配置

module.exports = {
  publicPath: '/',
  outputDir: '../web',
  indexPath: './index.html',
  lintOnSave: false,
  crossorigin: 'anonymous',
  assetsDir: '',
  integrity: true,
  productionSourceMap: false,
  devServer: {
    proxy: {
      '/csf-permission/': {
        target: 'http://192.168.100.44:8011/csf-permission/',
        changeOrigin: true,
        pathRewrite: {
          '^/csf-permission/': ''
        }
      },
      '/api/': {
        target: 'http://192.168.250.213:50010/ds/',
        changeOrigin: true,
        pathRewrite: {
          '^/api/': ''
        }
      }
    }
  },
  configureWebpack: {
    output: {
      filename: process.env.NODE_ENV === 'production' ? 'js/[name].[contenthash:8].js' : 'js/[name].[hash:8].js',
      chunkFilename: process.env.NODE_ENV === 'production' ? 'js/[name].[chunkhash:8].js' : 'js/[name].[hash:8].js'
    },
    optimization: {
      minimize: true,
      minimizer: [
        // new UglifyJSPlugin()
      ],
      runtimeChunk: 'single',
      splitChunks: {
        chunks: 'all',
        maxInitialRequests: Infinity,
        minSize: 0,
        minChunks: 1,
        automaticNameDelimiter: '.',
        cacheGroups: {
          main: {
            name: 'main',
            test: /[\\/]node_modules[\\/]vue/,
            priority: 20
          },
          'element-ui': {
            name: 'main',
            test: /[\\/]node_modules[\\/]element-ui/,
            priority: 20
          },
          utils: {
            name: 'utils',
            test: /[\\/]node_modules[\\/](axios|lodash|qs)/,
            priority: 14
          },
          encrypt: {
            name: 'encrypt',
            test: /[\\/]node_modules[\\/](js-md5|node-forge)/,
            priority: 13
          },
          vendors: {
            name: 'vendors',
            test: /[\\/]node_modules[\\/]/,
            priority: 10
          }
        }
      }
    }
  },
  pluginOptions: {
    i18n: {
      locale: 'zh-CN',
      fallbackLocale: 'zh-CN',
      localeDir: 'locales',
      enableInSFC: true
    }
  }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值