Skip to content

Commit

Permalink
chore: fix build to use defined global object ("this" instead of "self")
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Heck committed Apr 12, 2024
1 parent 6ccb353 commit 9348997
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dist/cm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ide.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/klaro-no-translations.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/klaro.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/translations.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const STYLE_FILES = /\.(sa|sc|c)ss$/;

const SEPARATE_CSS = process.env.SEPARATE_CSS !== undefined;

const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const BundleAnalyzerPlugin =
require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const ANALYZE_BUNDLE = process.env.ANALYZE_BUNDLE !== undefined;

let config = {
Expand Down Expand Up @@ -38,22 +39,23 @@ let config = {
exclude: /node_modules/,
include: [SRC_DIR],
loader: 'babel-loader',
}
},
],
},
entry: {
'klaro': path.join(SRC_DIR, 'klaro.js'),
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')
ide: path.join(SRC_DIR, 'ide.js'),
},
output: {
path: BUILD_DIR,
filename: SEPARATE_CSS ? '[name]-no-css.js' : '[name].js',
library: '[name]',
libraryTarget: 'umd',
publicPath: '',
globalObject: 'this',
},
plugins: [],
};
Expand Down Expand Up @@ -91,7 +93,7 @@ if (SEPARATE_CSS) {
{
loader: 'sass-loader',
options: {
implementation: require.resolve("sass"),
implementation: require.resolve('sass'),
sassOptions: {
sourceMap: APP_ENV === 'development',
outputStyle: NO_MINIFY_CSS ? 'expanded' : 'compressed',
Expand All @@ -102,10 +104,8 @@ if (SEPARATE_CSS) {
});
config.plugins.push(
new MiniCssExtractPlugin({
filename: NO_MINIFY_CSS
? '[name].css'
: '[name].min.css',
}),
filename: NO_MINIFY_CSS ? '[name].css' : '[name].min.css',
})
);
} else {
config.module.rules.push({
Expand All @@ -128,7 +128,7 @@ if (SEPARATE_CSS) {
{
loader: 'sass-loader',
options: {
implementation: require.resolve("sass"),
implementation: require.resolve('sass'),
},
},
],
Expand Down

0 comments on commit 9348997

Please sign in to comment.