forked from luminati-io/luminati-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
executable file
·29 lines (25 loc) · 877 Bytes
/
webpack.config.js
File metadata and controls
executable file
·29 lines (25 loc) · 877 Bytes
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
// LICENSE_CODE ZON ISC
'use strict'; /*jslint node:true*/
const {merge} = require('webpack-merge');
const common_config = require('./webpack.common.js');
const prod_config = require('./webpack.prod.js');
const dev_config = require('./webpack.dev.js');
const merged = conf=>merge(common_config, conf);
const from_obj = env=>{
if (env.production)
return merged(prod_config);
if (env.development)
return merged(dev_config);
throw new Error(`Webpack configuration for ${JSON.stringify(env)}`
+' was not found!');
};
const from_str = env=>{
switch (env)
{
case 'production': return merged(prod_config);
case 'development': return merged(dev_config);
default:
throw new Error(`Webpack configuration for ${env} was not found!`);
}
};
module.exports = env=>typeof env==='string' ? from_str(env) : from_obj(env);