samrum / vite-plugin-web-extension

A vite plugin for generating cross browser platform, ES module based web extensions.
MIT License
325 stars 32 forks source link

DevBuilder’s output path should respect the `root` property of ViteConfig #81

Closed haruleekim closed 1 year ago

haruleekim commented 1 year ago

I noticed some issues while using this plugin.

  1. DevBuilder's ourDir is not consistent.

    Looking at the code written, I think you intended to refer to the same location as outDir in ViteConfig. But it doesn't work if $(cwd) is not the same as the root of ViteConfig. So I modified outDir's path resolution logic to refer to the root of ViteConfig.

  2. DevBuilder always tries to copy the $(cwd)/public directory.

    This path must also be determined by referring to the root of ViteConfig, not $(cwd). And the publicDir property of ViteConfig, not const literal "public". So I modified them to do so.

Thank you so much for creating this good plugin.