Skip to content

Commit

Permalink
fix: avoid using eval in client (#5045)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Feb 13, 2024
1 parent 54abef7 commit 7681477
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
10 changes: 0 additions & 10 deletions client-src/modules/logger/SyncBailHookFake.js

This file was deleted.

11 changes: 11 additions & 0 deletions client-src/modules/logger/tapable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function SyncBailHook() {
return {
call() {},
};
}

/**
* Client stub for tapable SyncBailHook
*/
// eslint-disable-next-line import/prefer-default-export
export { SyncBailHook };
22 changes: 9 additions & 13 deletions client-src/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ const path = require("path");
const webpack = require("webpack");
const { merge } = require("webpack-merge");

// @ts-ignore
const library = webpack.webpack
? {
library: {
// type: "module",
type: "commonjs",
},
}
: { libraryTarget: "umd" };
const library = {
library: {
// type: "module",
type: "commonjs",
},
};

const baseForModules = {
devtool: false,
Expand All @@ -28,8 +25,7 @@ const baseForModules = {
optimization: {
minimize: false,
},
// @ts-ignore
target: webpack.webpack ? ["web", "es5"] : "web",
target: ["web", "es5"],
module: {
rules: [
{
Expand Down Expand Up @@ -73,8 +69,8 @@ module.exports = [
'(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })',
}),
new webpack.NormalModuleReplacementPlugin(
/^tapable\/lib\/SyncBailHook/,
path.join(__dirname, "modules/logger/SyncBailHookFake.js"),
/^tapable$/,
path.join(__dirname, "modules/logger/tapable.js"),
),
],
}),
Expand Down

0 comments on commit 7681477

Please sign in to comment.