forked from Keeper-Wallet/Keeper-Wallet-Extension
-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
32 lines (29 loc) · 987 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
const conf = require('./scripts/webpack.config');
const prodConf = require('./scripts/webpack.prod.config');
const defConf = require('./scripts/webpack.dev.config');
const getVersion = require('./scripts/getVersion');
const buildConfig = require('./init_config.json');
const config = { ...buildConfig };
const DIST = config.DIST || 'dist';
const LANGS = config.LANGS || ['en'];
const PAGE_TITLE = config.PAGE_TITLE || 'TurtleShell';
const PLATFORMS = config.PLATFORMS || ['chrome', 'firefox', 'opera', 'edge'];
module.exports = () => {
const version = getVersion();
if (!version) {
throw 'Build failed';
}
const isProduction = process.env.NODE_ENV === 'production';
const configFn = isProduction ? prodConf : defConf;
return configFn(
{
...conf({
version,
DIST,
PLATFORMS,
LANGS,
PAGE_TITLE,
isProduction,
})
});
};