forked from openlayers/ol-cesium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
35 lines (31 loc) · 1.11 KB
/
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
// eslint-disable-next-line import/no-unresolved
const webpackMerge = require('webpack-merge');
const commons = require('./buildtools/webpack.commons');
let config = commons.config;
const nodeEnv = process.env['NODE_ENV'] || 'development';
switch (nodeEnv) {
case 'development':
config = webpackMerge(config, require('./buildtools/webpack.dev.js'));
break;
case 'production':
config = webpackMerge(config, require('./buildtools/webpack.prod.js'));
break;
default:
console.log(`The 'NODE_ENV' environement variable is set to an invalid value: ${process.env.NODE_ENV}.`);
process.exit(2);
}
switch (process.env.TARGET) {
case 'examples':
config = webpackMerge(config, require('./buildtools/webpack.examples.js'));
break;
case 'library':
config = webpackMerge(config, require('./buildtools/webpack.library.js'));
break;
case 'umd':
config = webpackMerge(config, require('./buildtools/webpack.umd.js'));
break;
default:
console.log(`The 'TARGET' environement variable is set to an invalid value: ${process.env.TARGET}.`);
process.exit(2);
}
module.exports = config;