forked from camptocamp/ngeo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
34 lines (30 loc) · 1.07 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
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 invalide value: ${process.env.NODE_ENV}.` )
process.exit(2);
}
switch (process.env.TARGET) {
case 'ngeo-examples':
config = webpackMerge(config, require('./buildtools/webpack.ngeoexamples'));
break;
case 'gmf-examples':
config = webpackMerge(config, require('./buildtools/webpack.gmfexamples'));
break;
case 'gmf-apps':
config = webpackMerge(config, require('./buildtools/webpack.gmfapps'));
break;
default:
console.log(`The 'TARGET' environement variable is set to an invalide value: ${process.env.TARGET}.` )
process.exit(2);
}
module.exports = config