-
-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic gathering of used files for zip
#1505
Comments
If you're using a "package based" momorepo, not an integrated monorepo, vite is not aware of the sources of other local packages your extension depends on, only the already transpiled files of those packages. So no, there is no way for WXT to guarantee it will find all the files it needs. You will have to tell it which files to zip. Config for controlling the root directory that is zipped already exists: Here's an example from a old version of WXT: https://github.com/anime-skip/player/blob/main/apps/extension/wxt.config.ts Or, if you know vite is able to detect all the source files correctly in your project, you can dynamically generate the list yourself by hooking into the build process and changing which files get zipped. This can be done in a WXT module. |
I don't use local packages.
Exactly. That's what I'm proposing for WXT to support natively. This wouldn't just help people with (integrated) monorepos, but it would also save people from having to manually delete all the files the don't need in the zipped source code. |
Feature Request
I added the extension as a child to another project, kind of like a monorepo. The problem is that when I
zip
for Firefox it only includes the source files for the extension, but not files that the extension imports from the parent (or sibling) project. A possible way to do this might be; since Vite/Rollup should be aware of which files actually end up in the compiled output,zip
could follow the paths and add those files.Is your feature request related to a bug?
"N/A"
What are the alternatives?
Adding the files manually via
defineConfig({ zip: {} })
which is very tedious and doesn't scale.Additional context
"N/A"
The text was updated successfully, but these errors were encountered: