-
-
Notifications
You must be signed in to change notification settings - Fork 360
feat: add experimental autoIncludeExternalSources option for monorepo support #1826
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
base: main
Are you sure you want to change the base?
feat: add experimental autoIncludeExternalSources option for monorepo support #1826
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@@ -200,6 +200,24 @@ Depending on your package manager, the `package.json` in the sources zip will be | |||
WXT uses the command `npm pack <package-name>` to download the package. That means regardless of your package manager, you need to properly setup a `.npmrc` file. NPM and PNPM both respect `.npmrc` files, but Yarn and Bun have their own ways of authorizing private registries, so you'll need to add a `.npmrc` file. | |||
::: | |||
|
|||
#### Include External Sources (Experimental) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, if this is the right place to add the documentation 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably fine.
…o-include-external-sources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the idea, just need to see a better E2E test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests don't actually test the new behavior. Please actually include a external file in project, then extract and make sure the are included.
Here's an example of how to unzip and check for file existence: https://github.com/johnnyfekete/wxt/blob/d632e5c3cdd96421662b791c6d6008b32dde666e/packages/wxt/e2e/tests/zip.test.ts#L103-L123
@@ -200,6 +200,24 @@ Depending on your package manager, the `package.json` in the sources zip will be | |||
WXT uses the command `npm pack <package-name>` to download the package. That means regardless of your package manager, you need to properly setup a `.npmrc` file. NPM and PNPM both respect `.npmrc` files, but Yarn and Bun have their own ways of authorizing private registries, so you'll need to add a `.npmrc` file. | |||
::: | |||
|
|||
#### Include External Sources (Experimental) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably fine.
First real contribution here, hope I understood the issue correctly 🙂
Overview
Adds experimental
autoIncludeExternalSources
option to automatically include external source files in zip archives for monorepo setups.When enabled, WXT analyzes the build output to find imported files from outside the extension directory and includes them in the sources zip. This eliminates the need for manual configuration when extensions import from parent/sibling packages.
The feature is disabled by default for backward compatibility and marked as experimental.
Manual Testing
../shared-lib/utils.ts
import { util } from '../../../shared-lib/utils';
zip: { autoIncludeExternalSources: true }
wxt zip -b firefox
Related Issue
This PR closes #1505