Skip to content

Commit 15ad0d2

Browse files
committedNov 13, 2018
feat: drop workaround for "Uncaught TypeError: __webpack_require__(...) is not a function" to be compatible with webpack 5
1 parent f40aeae commit 15ad0d2

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed
 

‎lib/compiler.js

-12
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,6 @@ class HtmlWebpackChildCompiler {
119119
new LibraryTemplatePlugin('HTML_WEBPACK_PLUGIN_RESULT', 'var').apply(childCompiler);
120120
new LoaderTargetPlugin('node').apply(childCompiler);
121121

122-
// Fix for "Uncaught TypeError: __webpack_require__(...) is not a function"
123-
// Hot module replacement requires that every child compiler has its own
124-
// cache. @see https://github.com/ampedandwired/html-webpack-plugin/pull/179
125-
childCompiler.hooks.compilation.tap('HtmlWebpackPlugin', compilation => {
126-
if (compilation.cache) {
127-
if (!compilation.cache[compilerName]) {
128-
compilation.cache[compilerName] = {};
129-
}
130-
compilation.cache = compilation.cache[compilerName];
131-
}
132-
});
133-
134122
// Add all templates
135123
this.templates.forEach((template, index) => {
136124
new SingleEntryPlugin(childCompiler.context, template, `HtmlWebpackPlugin_${index}`).apply(childCompiler);

0 commit comments

Comments
 (0)
Please sign in to comment.