Skip to content

Commit

Permalink
fix: revert to the getHooks of HTML plugin (#3753)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Oct 18, 2024
1 parent 64f2406 commit 454d046
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/rspack/RsbuildHtmlPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ export class RsbuildHtmlPlugin {

compiler.hooks.compilation.tap(this.name, (compilation: Compilation) => {
getHTMLPlugin()
.getCompilationHooks(compilation)
// TODO: use getCompilationHooks in minor release
.getHooks(compilation)
.alterAssetTagGroups.tapPromise(this.name, async (data) => {
const entryName = data.plugin.options?.entryName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class HtmlPreloadOrPrefetchPlugin implements RspackPluginInstance {
apply(compiler: Compiler): void {
compiler.hooks.compilation.tap(this.constructor.name, (compilation) => {
getHTMLPlugin()
.getCompilationHooks(compilation)
.getHooks(compilation)
.beforeAssetTagGeneration.tap(
`HTML${upperFirst(this.type)}Plugin`,
(htmlPluginData) => {
Expand All @@ -206,7 +206,7 @@ export class HtmlPreloadOrPrefetchPlugin implements RspackPluginInstance {
);

getHTMLPlugin()
.getCompilationHooks(compilation)
.getHooks(compilation)
.alterAssetTags.tap(
`HTML${upperFirst(this.type)}Plugin`,
(htmlPluginData) => {
Expand Down

0 comments on commit 454d046

Please sign in to comment.