forked from bcgov/fas-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
79 lines (78 loc) · 2.47 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const webpack = require('webpack')
const path = require('path')
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: {
externals: [
function (context, request, callback) {
// If library, use externals, otherwise the Vue/ composition-api instance in Auth-web will have issues.
if (process.env.VUE_CLI_BUILD_TARGET === 'lib' && (/^@vue\/composition-api$/.test(request) || /^vue$/.test(request))) {
return callback(null, request)
}
callback()
}
],
plugins: [
new webpack.DefinePlugin({
'process.env': {
ABOUT_TEXT:
(aboutText1 && aboutText2) ? `"${aboutText1}<br>${aboutText2}"`
: aboutText1 ? `"${aboutText1}"`
: aboutText2 ? `"${aboutText2}"`
: ''
}
})
],
devtool: 'source-map',
resolve: {
alias: {
$assets: path.resolve('./src/assets/')
}
}
},
publicPath: process.env.VUE_APP_PATH,
transpileDependencies: ['vuetify', 'vuex-persist'],
devServer: {
overlay: {
warnings: true,
errors: true
}
},
pwa: {
name: 'Business Registry',
themeColor: '#003366',
msTileColor: '#fcba19',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black',
manifestOptions: {
name: 'Business Registry fas',
short_name: 'Business Registry fas',
start_url: '',
display: 'standalone',
theme_color: '#003366',
background_color: '#fcba19',
scope: '.'
},
iconPaths: {
favicon32: 'img/icons/favicon-32x32.png',
favicon16: 'img/icons/favicon-16x16.png',
appleTouchIcon: 'img/icons/apple-touch-icon-152x152.png',
maskIcon: 'img/icons/safari-pinned-tab.svg',
msTileImage: 'img/icons/msapplication-icon-144x144.png'
},
workboxPluginMode: 'InjectManifest',
workboxOptions: {
// swSrc is required in InjectManifest mode.
swSrc: 'src/service-worker.js',
// skip precaching json files such as configs
exclude: [/\.json$/]
}
}
}