Skip to content

Commit 5395d2d

Browse files
authored
Merge pull request #529 from werk21/cherry-pick-54eba64
Fixed #515 and #527 (klaro-no-translations.js build contains all the …
2 parents c8031d4 + 2cf39da commit 5395d2d

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

webpack.base.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ let config = {
4343
},
4444
entry: {
4545
'klaro': path.join(SRC_DIR, 'klaro.js'),
46-
'klaro-no-translations': path.join(SRC_DIR, 'klaro.js'),
4746
cm: path.join(SRC_DIR, 'consent-manager.js'),
4847
translations: path.join(SRC_DIR, 'translations.js'),
4948
ide: path.join(SRC_DIR, 'ide.js')

webpack.config.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
const { merge } = require('webpack-merge');
2+
const path = require('path');
3+
const SRC_DIR = path.resolve(__dirname, 'src');
24
const baseConfig = require('./webpack.base.js');
35
const prodConfig = require('./webpack.prod.js');
46
const devConfig = require('./webpack.dev.js');
57

68
module.exports = (env, argv) => {
79
switch (argv.mode) {
810
case 'development':
9-
return merge(baseConfig, devConfig);
11+
var config = merge(baseConfig, devConfig);
12+
break;
1013
case 'production':
11-
return merge(baseConfig, prodConfig);
14+
var config = merge(baseConfig, prodConfig);
15+
break;
1216
default:
1317
throw new Error('No matching configuration was found!');
1418
}
19+
// Create config2 for klaro-no-translations.
20+
let config2 = {
21+
...config,
22+
entry: {
23+
'klaro-no-translations': path.join(SRC_DIR, 'klaro-no-translations.js'),
24+
},
25+
output: {
26+
...config.output,
27+
library: 'klaro',
28+
}
29+
};
30+
return [config, config2];
1531
};

0 commit comments

Comments
 (0)