forked from luniehq/lunie
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
85 lines (80 loc) · 2.53 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
80
81
82
83
84
85
const path = require(`path`)
const webpack = require(`webpack`)
const CSPWebpackPlugin = require(`csp-webpack-plugin`)
const { version } = require("./package.json")
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: `/`,
chainWebpack: config => {
config.plugins.delete(`prefetch`)
},
configureWebpack: () => {
const config = {
resolve: {
alias: {
src: resolve(`src`),
"@": resolve(`src`),
assets: resolve(`src/assets`),
scripts: resolve(`src/scripts`),
common: resolve(`src/components/common`),
governance: resolve(`src/components/governance`),
network: resolve(`src/components/network`),
staking: resolve(`src/components/staking`),
transactions: resolve(`src/components/transactions`),
wallet: resolve(`src/components/wallet`),
test: resolve(`test`)
},
extensions: [`.js`, `.vue`, `.css`]
},
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
NETWORK: JSON.stringify(process.env.NETWORK),
SENTRY_DSN: JSON.stringify(process.env.SENTRY_DSN),
LUNIE_VERSION: JSON.stringify(version),
GOOGLE_ANALYTICS_UID: JSON.stringify(
process.env.GOOGLE_ANALYTICS_UID
),
MOBILE_APP: JSON.stringify(process.env.MOBILE_APP)
}
})
],
optimization: {
splitChunks: {
chunks: "all"
}
}
}
if (process.env.NODE_ENV === `production` && !process.env.E2E_TESTS) {
config.plugins.push(
// adds the content security policy to the index.html
new CSPWebpackPlugin({
"object-src": `'none'`,
"base-uri": `'self'`,
"default-src": `'self'`,
"script-src": [`'self'`, `https://*.lunie.io`],
"worker-src": `'none'`,
"style-src": [`'self'`, `'unsafe-inline'`],
"connect-src": [
// third party tools
`https://api-iam.intercom.io`,
// mainnet
`https://lcd.nylira.net`,
`https://gaia-13006.lunie.io`
],
"frame-src": [`'self'`, `https://api-iam.intercom.io`],
"img-src": [`'self'`, `https://www.google-analytics.com/`]
})
)
}
return config
},
pluginOptions: {
lintStyleOnBuild: false,
stylelint: {}
}
}