diff --git a/webpack.base.js b/webpack.base.js index 29c8678e..b7e71922 100644 --- a/webpack.base.js +++ b/webpack.base.js @@ -43,7 +43,6 @@ let config = { }, entry: { 'klaro': path.join(SRC_DIR, 'klaro.js'), - 'klaro-no-translations': path.join(SRC_DIR, 'klaro.js'), cm: path.join(SRC_DIR, 'consent-manager.js'), translations: path.join(SRC_DIR, 'translations.js'), ide: path.join(SRC_DIR, 'ide.js') diff --git a/webpack.config.js b/webpack.config.js index 01a050c0..83f2ea84 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,6 @@ 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'); @@ -6,10 +8,24 @@ const devConfig = require('./webpack.dev.js'); module.exports = (env, argv) => { switch (argv.mode) { case 'development': - return merge(baseConfig, devConfig); + var config = merge(baseConfig, devConfig); + break; case 'production': - return merge(baseConfig, prodConfig); + 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]; }; \ No newline at end of file