forked from bcgov/namerequest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
64 lines (63 loc) · 1.81 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const path = require('path')
const webpack = require('webpack')
const fs = require('fs')
const packageJson = fs.readFileSync('./package.json')
const appName = JSON.parse(packageJson).appName
const appVersion = JSON.parse(packageJson).version
const sbcName = JSON.parse(packageJson).sbcName
const sbcVersion = JSON.parse(packageJson).dependencies['sbc-common-components']
const aboutText1 = (appName && appVersion) ? `${appName} v${appVersion}` : ''
const aboutText2 = (sbcName && sbcVersion) ? `${sbcName} v${sbcVersion}` : ''
module.exports = {
configureWebpack: {
devtool: 'eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': {
ABOUT_TEXT:
(aboutText1 && aboutText2) ? `"${aboutText1}<br>${aboutText2}"`
: aboutText1 ? `"${aboutText1}"`
: aboutText2 ? `"${aboutText2}"`
: ''
}
})
],
devServer: {
hot: true
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json', '.vue', '.jsx']
},
module: {
rules: [
{
test: /\.scss$/,
use: ['postcss-loader']
}
]
}
},
transpileDependencies: [
'vuetify',
'vuex-module-decorators'
],
publicPath: process.env.VUE_APP_PATH,
devServer: {
proxy: {
// this is needed to prevent a CORS error when running locally
'/local-keycloak-config-url/*': {
target: 'https://dev.bcregistry.ca/namerequest/config/kc/',
pathRewrite: {
'/local-keycloak-config-url': ''
}
},
// this is needed to avoid a PAYBC Not Found error when running locally
'/status/PAYBC': {
target: 'https://status-api-dev.apps.silver.devops.gov.bc.ca/api/v1/status/PAYBC',
pathRewrite: {
'/status/PAYBC': ''
}
}
}
}
}