-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
34 lines (32 loc) · 1.06 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
const CopyPlugin = require('copy-webpack-plugin')
process.env.VUE_APP_VERSION = require('./package.json').version
process.env.VUE_APP_BUILD_DATE = new Date().toUTCString()
module.exports = {
runtimeCompiler: true,
publicPath: process.env.NODE_ENV === 'production'
? '/webview/'
: '/',
configureWebpack: {
plugins: [
new CopyPlugin({
patterns: [
{
from: 'src/configuration.json',
to: 'configuration.json',
transform (content, absoluteFrom) {
const config = JSON.parse(content.toString())
config.backend = process.env.VUE_APP_METRICQ_BACKEND
if (process.env.VUE_APP_METRICQ_BACKEND_AUTH !== undefined) {
const [user, password] = process.env.VUE_APP_METRICQ_BACKEND_AUTH.split(':')
config.user = user
config.password = password
}
config.legacyCharts = process.env.VUE_APP_LEGACY_CHARTS
return JSON.stringify(config)
}
}
]
})
]
}
}