forked from ava-labs/avalanche-wallet
-
Notifications
You must be signed in to change notification settings - Fork 4
/
vue.config.js
73 lines (71 loc) · 2.38 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
const TerserPlugin = require('terser-webpack-plugin')
const ProvidePlugin = require('webpack/lib/ProvidePlugin')
const path = require('path')
process.env.VUE_APP_VERSION = process.env.npm_package_version
RegExp.prototype.toJSON = RegExp.prototype.toString
module.exports = {
transpileDependencies: ['vuetify'],
devServer: {
/**
* For e2e testing we turn this off using vue cli --mode e2e
* @link https://cli.vuejs.org/guide/mode-and-env.html#modes
*/
https: !process.env.USE_HTTP,
port: 5000,
},
css: { extract: false },
// publicPath: '',
configureWebpack: (config) => {
if (process.env.VUE_CLI_BUILD_TARGET === 'wc') {
if (process.env.NODE_ENV === 'development') {
config.devtool = 'source-map'
}
} else if (process.env.NODE_ENV === 'production') {
config.optimization = {
minimize: true,
minimizer: [new TerserPlugin()],
splitChunks: {
chunks: 'all',
minSize: 600 * 1000,
maxSize: 2000 * 1000,
},
}
}
config.resolve = {
extensions: ['.tsx', '.ts', '.js', '.vue'],
fallback: {
assert: require.resolve('assert/'),
buffer: require.resolve('buffer/'),
crypto: require.resolve('crypto-browserify'),
http: false,
https: false,
os: false,
stream: require.resolve('stream-browserify'),
},
alias: {
'~root/./src': path.resolve(__dirname, 'src'),
'@': path.resolve(__dirname, 'src'),
'/img': false,
},
}
config.plugins.push(
new ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
})
)
},
pwa: {
name: 'Camino Wallet',
manifestOptions: {
start_url: '/',
},
iconPaths: {
favicon16: 'img/icons/favicon-16x16.png',
favicon32: 'img/icons/favicon-32x32.png',
appleTouchIcon: 'img/icons/apple-touch-icon.png',
maskIcon: 'img/icons/favicon-32x32.png',
msTileImage: 'img/icons/mstile-150x150.png',
},
},
}