Skip to content

Commit

Permalink
feat: try to use emitFile in writeBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
yzydeveloper committed Aug 11, 2022
1 parent 79627eb commit 161871d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/core/src/htmlFixPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ export function createHtmlFixPlugin(options: Options): Plugin {
}
}
},
writeBundle() {
emittedFiles.forEach(emittedFile => {
this.emitFile({
fileName: emittedFile.fileName,
type: 'asset',
source: emittedFile.source
})
})
},
closeBundle() {
if (!isProduction(viteConfig.mode)) return
const root = slash(viteConfig.root || process.cwd())
Expand Down

0 comments on commit 161871d

Please sign in to comment.