123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- const appConfig = require("./public/config");
- module.exports = {
- //设置为空打包后不分更目录还是多级目录
- publicPath: appConfig.AppConfig.Sub_Domain,
- //build编译后存放静态文件的目录
- //assetsDir: "static",
- // build编译后不生成资源MAP文件
- productionSourceMap: false,
- //开发服务build后的生产模式还需nginx代理
- devServer: {
- open: false, //运行后自动打开浏览器 port: 9304, //挂载端口
- port: appConfig.AppConfig.APP_Port, //挂载端口
- proxy: {
- '/api': {
- target: appConfig.AppConfig.API_URL,
- ws: true,
- changeOrigin: true,
- pathRewrite: {
- '^/api': ''
- }
- },
- }
- },
- chainWebpack: config => {
- // 移除 prefetch 插件
- config.plugins.delete('preload');
- config.plugins.delete('prefetch');
- config.resolve.alias.set('vue-i18n', 'vue-i18n/dist/vue-i18n.cjs.js');
- },
- configureWebpack: {
- //性能提示
- performance: {
- hints: false
- },
- optimization: {
- splitChunks: {
- chunks: "all",
- automaticNameDelimiter: '~',
- name: "scuiChunks",
- cacheGroups: {
- //第三方库抽离
- vendor: {
- name: "modules",
- test: /[\\/]node_modules[\\/]/,
- priority: -10
- },
- elicons: {
- name: "elicons",
- test: /[\\/]node_modules[\\/]@element-plus[\\/]icons-vue[\\/]/
- },
- // tinymce: {
- // name: "tinymce",
- // test: /[\\/]node_modules[\\/]tinymce[\\/]/
- // },
- // echarts: {
- // name: "echarts",
- // test: /[\\/]node_modules[\\/]echarts[\\/]/
- // },
- xgplayer: {
- name: "xgplayer",
- test: /[\\/]node_modules[\\/]xgplayer.*[\\/]/
- },
- // codemirror: {
- // name: "codemirror",
- // test: /[\\/]node_modules[\\/]codemirror[\\/]/
- // }
- }
- }
- }
- }
- }
- // })
|