-
Notifications
You must be signed in to change notification settings - Fork 36
/
vue.config.js
49 lines (46 loc) · 1.16 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* eslint-disable @typescript-eslint/no-var-requires */
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
const getVersion = () => {
const matched = process.env.npm_package_version.match(/^\d\.\d/)
return matched ? `v${matched[0]}` : 'latest'
}
process.env.VUE_APP_EMQX_VERSION = getVersion()
const { HOST_URL } = process.env
const target = HOST_URL || 'http://localhost:18083/'
module.exports = {
devServer: {
port: 7000,
proxy: {
'/api/v5': {
target,
changeOrigin: true,
},
},
},
css: {
requireModuleExtension: true,
},
assetsDir: 'static',
publicPath: './',
productionSourceMap: false,
transpileDependencies: ['@vue-flow/core', '@emqx/shared-ui-utils'],
configureWebpack: {
plugins: [
new MonacoWebpackPlugin({
languages: ['javascript', 'json', 'sql', 'plaintext'],
globalAPI: true,
}),
],
},
chainWebpack: (config) => {
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
monacoEditor: {
name: 'chunk-monaco-editor',
test: /[\\/]node_modules[\\/]monaco-editor[\\/]/,
},
},
})
},
}