Skip to content

Commit

Permalink
feat: drop workaround for "Uncaught TypeError: __webpack_require__(..…
Browse files Browse the repository at this point in the history
….) is not a function" to be compatible with webpack 5
  • Loading branch information
jantimon committed Nov 13, 2018
1 parent f40aeae commit 15ad0d2
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions lib/compiler.js
Expand Up @@ -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);
Expand Down

0 comments on commit 15ad0d2

Please sign in to comment.