Skip to content

Commit

Permalink
feat(rspack): support buildStart
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyatex committed Jul 3, 2023
1 parent 3a70669 commit 16a127d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rspack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ export function getRspackPlugin<UserOptions = {}>(
if (plugin.rspack)
plugin.rspack(compiler)

if (plugin.buildStart) {
compiler.hooks.make.tapPromise(plugin.name, async (compilation) => {
const context = createRspackContext(compilation)
if (plugin.buildStart)
return await plugin.buildStart.call(context)
})
}

if (plugin.buildEnd) {
compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => {
await plugin.buildEnd!.call(createRspackContext(compilation))
Expand Down

0 comments on commit 16a127d

Please sign in to comment.