Skip to content

Commit 454d046

Browse files
authored
fix: revert to the getHooks of HTML plugin (#3753)
1 parent 64f2406 commit 454d046

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/core/src/rspack/RsbuildHtmlPlugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ export class RsbuildHtmlPlugin {
310310

311311
compiler.hooks.compilation.tap(this.name, (compilation: Compilation) => {
312312
getHTMLPlugin()
313-
.getCompilationHooks(compilation)
313+
// TODO: use getCompilationHooks in minor release
314+
.getHooks(compilation)
314315
.alterAssetTagGroups.tapPromise(this.name, async (data) => {
315316
const entryName = data.plugin.options?.entryName;
316317

packages/core/src/rspack/preload/HtmlPreloadOrPrefetchPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class HtmlPreloadOrPrefetchPlugin implements RspackPluginInstance {
189189
apply(compiler: Compiler): void {
190190
compiler.hooks.compilation.tap(this.constructor.name, (compilation) => {
191191
getHTMLPlugin()
192-
.getCompilationHooks(compilation)
192+
.getHooks(compilation)
193193
.beforeAssetTagGeneration.tap(
194194
`HTML${upperFirst(this.type)}Plugin`,
195195
(htmlPluginData) => {
@@ -206,7 +206,7 @@ export class HtmlPreloadOrPrefetchPlugin implements RspackPluginInstance {
206206
);
207207

208208
getHTMLPlugin()
209-
.getCompilationHooks(compilation)
209+
.getHooks(compilation)
210210
.alterAssetTags.tap(
211211
`HTML${upperFirst(this.type)}Plugin`,
212212
(htmlPluginData) => {

0 commit comments

Comments
 (0)