121 lines
2.9 KiB
JavaScript
121 lines
2.9 KiB
JavaScript
'use strict'
|
|
const path = require('path')
|
|
|
|
function resolve(dir) {
|
|
return path.join(__dirname, dir)
|
|
}
|
|
|
|
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
|
|
|
|
module.exports = {
|
|
publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
|
|
outputDir: "saas-web",
|
|
lintOnSave: false,
|
|
productionSourceMap: false,
|
|
devServer: {
|
|
host: '0.0.0.0',
|
|
port: 8201,
|
|
public: 'saas.ape.ccoop.cc:99',
|
|
open: 'http://localhost:8201/',
|
|
disableHostCheck: true,
|
|
compress: true,
|
|
overlay: {
|
|
warnings: false,
|
|
errors: true
|
|
},
|
|
proxy: {
|
|
|
|
'/api/user-service': {
|
|
target: 'http://localhost:8202',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/api/user-service': '/'
|
|
}
|
|
},
|
|
'/n8n': {
|
|
target: 'https://n8n.ccoop.cc',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/n8n': ''
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
configureWebpack: {
|
|
externals: {
|
|
'vue': 'Vue',
|
|
'vue-router': 'VueRouter',
|
|
'vuex': 'Vuex',
|
|
'element-ui': 'ELEMENT',
|
|
'echarts': 'echarts',
|
|
'axios': 'axios',
|
|
'monaco-editor': 'monaco'
|
|
},
|
|
name: '账权云平台 ',
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve('src')
|
|
}
|
|
},
|
|
optimization: {
|
|
splitChunks: {
|
|
chunks: 'all',
|
|
maxInitialRequests: Infinity,
|
|
minSize: 20000,
|
|
cacheGroups: {
|
|
monaco: {
|
|
name: 'chunk-monaco',
|
|
test: /[\\/]node_modules[\\/](monaco-editor|vue-monaco)[\\/]/,
|
|
priority: 40,
|
|
reuseExistingChunk: true
|
|
},
|
|
elementUI: {
|
|
name: 'chunk-element-ui',
|
|
test: /[\\/]node_modules[\\/]element-ui[\\/]/,
|
|
priority: 30,
|
|
reuseExistingChunk: true
|
|
},
|
|
echarts: {
|
|
name: 'chunk-echarts',
|
|
test: /[\\/]node_modules[\\/]echarts[\\/]/,
|
|
priority: 30,
|
|
reuseExistingChunk: true
|
|
},
|
|
wangEditor: {
|
|
name: 'chunk-wang-editor',
|
|
test: /[\\/]node_modules[\\/]@wangeditor[\\/]/,
|
|
priority: 30,
|
|
reuseExistingChunk: true
|
|
},
|
|
vue: {
|
|
name: 'chunk-vue',
|
|
test: /[\\/]node_modules[\\/](vue|vue-router|vuex)[\\/]/,
|
|
priority: 30,
|
|
reuseExistingChunk: true
|
|
},
|
|
axios: {
|
|
name: 'chunk-axios',
|
|
test: /[\\/]node_modules[\\/]axios[\\/]/,
|
|
priority: 30,
|
|
reuseExistingChunk: true
|
|
},
|
|
libs: {
|
|
name: 'chunk-libs',
|
|
test: /[\\/]node_modules[\\/]/,
|
|
priority: 10,
|
|
reuseExistingChunk: true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
chainWebpack(config) {
|
|
config.plugins.delete('preload')
|
|
config.plugins.delete('prefetch')
|
|
config.plugins.delete('optimize-css');
|
|
|
|
}
|
|
}
|