aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
653 stars 58 forks source link

fix: onBundleReady called before manifest is generated in build mode #221

Closed alvkN closed 6 days ago

alvkN commented 1 week ago

There is one issue in #219 that causes the newly introduced onBundleReady callback to be called before the manifest is generated (as a file). The root cause of this issue is that rollup.emitFile (which is used for build mode) only marks the file, and actually all the files are created as a part of the generateBundle hook. To ensure that all the files are already exist in outDir, the flow has been updated to call onBundleReady from the writeBundle hook for build mode. Dev mode is not affected.