forked from kiprotect/klaro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
31 lines (30 loc) · 859 Bytes
/
webpack.config.js
File metadata and controls
31 lines (30 loc) · 859 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
30
31
const { merge } = require('webpack-merge');
const path = require('path');
const SRC_DIR = path.resolve(__dirname, 'src');
const baseConfig = require('./webpack.base.js');
const prodConfig = require('./webpack.prod.js');
const devConfig = require('./webpack.dev.js');
module.exports = (env, argv) => {
switch (argv.mode) {
case 'development':
var config = merge(baseConfig, devConfig);
break;
case 'production':
var config = merge(baseConfig, prodConfig);
break;
default:
throw new Error('No matching configuration was found!');
}
// Create config2 for klaro-no-translations.
let config2 = {
...config,
entry: {
'klaro-no-translations': path.join(SRC_DIR, 'klaro-no-translations.js'),
},
output: {
...config.output,
library: 'klaro',
}
};
return [config, config2];
};