forked from unisat-wallet/extension
-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.js
35 lines (30 loc) · 961 Bytes
/
webpack.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
const webpackMerge = require('webpack-merge');
const commonConfig = require('./build/webpack.common.config');
const configs = {
dev: require('./build/webpack.dev.config'),
pro: require('./build/webpack.pro.config'),
debug: require('./build/webpack.debug.config')
};
const config = (env) => {
if (env.config == 'dev') {
process.env.NODE_ENV = 'development';
process.env.BABEL_ENV = 'development';
} else {
process.env.NODE_ENV = 'production';
process.env.BABEL_ENV = 'production';
process.env.TAILWIND_MODE = 'watch';
}
const toAdd = {
resolve: {
fallback: {
vm: require.resolve('vm-browserify')
}
},
ignoreWarnings: [/./]
};
if (env.config) {
return webpackMerge.merge(commonConfig(env), configs[env.config], toAdd);
}
return webpackMerge.merge(commonConfig(env), toAdd);
};
module.exports = config;