Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc79f2cf

Browse files
authored
fix: memoy leak (#1836)
1 parent7effc30 commitc79f2cf

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

‎lib/child-compiler.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
/**@typedef {import("webpack").sources.Source} Source */
1414
/**@typedef {{hash: string, entry: Chunk, content: string, assets: {[name: string]: { source: Source, info: import("webpack").AssetInfo }}}} ChildCompilationTemplateResult */
1515

16-
letinstanceId=0;
1716
/**
1817
* The HtmlWebpackChildCompiler is a helper to allow reusing one childCompiler
1918
* for multiple HtmlWebpackPlugin instances to improve the compilation performance.
@@ -24,8 +23,6 @@ class HtmlWebpackChildCompiler {
2423
*@param {string[]} templates
2524
*/
2625
constructor(templates){
27-
/** Id for this ChildCompiler */
28-
this.id=instanceId++;
2926
/**
3027
*@type {string[]} templateIds
3128
* The template array will allow us to keep track which input generated which output
@@ -110,12 +107,12 @@ class HtmlWebpackChildCompiler {
110107
childCompiler.context=mainCompilation.compiler.context;
111108

112109
// Generate output file names
113-
consttemporaryTemplateNames=this.templates.map((template,index)=>`__child-HtmlWebpackPlugin_${index}-${this.id}`);
110+
consttemporaryTemplateNames=this.templates.map((template,index)=>`__child-HtmlWebpackPlugin_${index}-${template}`);
114111

115112
// Add all templates
116113
this.templates.forEach((template,index)=>{
117-
newEntryPlugin(childCompiler.context,'data:text/javascript,__webpack_public_path__ = __webpack_base_uri__ = htmlWebpackPluginPublicPath;',`HtmlWebpackPlugin_${index}-${this.id}`).apply(childCompiler);
118-
newEntryPlugin(childCompiler.context,template,`HtmlWebpackPlugin_${index}-${this.id}`).apply(childCompiler);
114+
newEntryPlugin(childCompiler.context,'data:text/javascript,__webpack_public_path__ = __webpack_base_uri__ = htmlWebpackPluginPublicPath;',`HtmlWebpackPlugin_${index}-${template}`).apply(childCompiler);
115+
newEntryPlugin(childCompiler.context,template,`HtmlWebpackPlugin_${index}-${template}`).apply(childCompiler);
119116
});
120117

121118
// The templates are compiled and executed by NodeJS - similar to server side rendering

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp