From 15ad0d260443edfdcc953fa08c675c90c063bac7 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Fri, 9 Nov 2018 10:25:45 +0100 Subject: [PATCH] feat: drop workaround for "Uncaught TypeError: __webpack_require__(...) is not a function" to be compatible with webpack 5 --- lib/compiler.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/compiler.js b/lib/compiler.js index 293cfe82..89603602 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -119,18 +119,6 @@ class HtmlWebpackChildCompiler { new LibraryTemplatePlugin('HTML_WEBPACK_PLUGIN_RESULT', 'var').apply(childCompiler); new LoaderTargetPlugin('node').apply(childCompiler); - // Fix for "Uncaught TypeError: __webpack_require__(...) is not a function" - // Hot module replacement requires that every child compiler has its own - // cache. @see https://github.com/ampedandwired/html-webpack-plugin/pull/179 - childCompiler.hooks.compilation.tap('HtmlWebpackPlugin', compilation => { - if (compilation.cache) { - if (!compilation.cache[compilerName]) { - compilation.cache[compilerName] = {}; - } - compilation.cache = compilation.cache[compilerName]; - } - }); - // Add all templates this.templates.forEach((template, index) => { new SingleEntryPlugin(childCompiler.context, template, `HtmlWebpackPlugin_${index}`).apply(childCompiler);