forked from MyEtherWallet/MyEtherWallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
55 lines (55 loc) · 1.45 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
const Dotenv = require('dotenv-webpack');
const ImageminPlugin = require('imagemin-webpack-plugin').default;
const webpack = require('webpack');
const { UnusedFilesWebpackPlugin } = require('unused-files-webpack-plugin');
const webpackConfig = {
node: {
process: true
},
devServer: {
https: true,
host: 'localhost',
hotOnly: true,
port: 8080
},
plugins: [
new Dotenv({
systemvars: true,
silent: true
}),
new webpack.NormalModuleReplacementPlugin(/^any-promise$/, 'bluebird'),
new ImageminPlugin({
test: /\.(jpe?g|png|gif|svg)$/i,
disable: process.env.NODE_ENV !== 'production',
pngquant: {
quality: '95-100'
}
})
]
};
if (process.env.NODE_ENV === 'production') {
webpackConfig.plugins.push(new UnusedFilesWebpackPlugin({
patterns: ['src/**/*.*'],
failOnUnused: true,
globOptions: {
ignore: [
'src/assets/images/flags/countries.json',
'src/assets/images/networks/esn.svg',
'src/translations/README.md',
'src/translations/terms-of-conditions/en_US.json',
'src/wallets/hybrid/MEWconnect/deterministicWalletPaths.js',
'src/wallets/hardware/deterministicWalletPaths.js'
]
}
}));
}
module.exports = {
baseUrl: './',
configureWebpack: webpackConfig,
chainWebpack: config => {
config.module
.rule('eslint')
.use('eslint-loader')
.options({ fix: true });
}
};