Skip to content

Commit

Permalink
Add TextEncoder manually to fix react 18 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
hshoja committed Jun 9, 2023
1 parent 6d740e6 commit c33c19e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ class HtmlWebpackPlugin {
require: require,
htmlWebpackPluginPublicPath: publicPath,
URL: require('url').URL,
__filename: templateWithoutLoaders
__filename: templateWithoutLoaders,
TextEncoder: global.TextEncoder,
TextDecoder: global.TextDecoder
});
const vmScript = new vm.Script(source, { filename: templateWithoutLoaders });
// Evaluate code and cast to string
Expand Down

0 comments on commit c33c19e

Please sign in to comment.