forked from openlayers/ol-cesium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
32 lines (28 loc) · 1 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
// 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'));
break;
case 'production':
config = webpackMerge(config, require('./buildtools/webpack.prod'));
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'));
break;
case 'library':
config = webpackMerge(config, require('./buildtools/webpack.library'));
break;
default:
console.log(`The 'TARGET' environement variable is set to an invalid value: ${process.env.TARGET}.`);
process.exit(2);
}
module.exports = config;