-
-
Notifications
You must be signed in to change notification settings - Fork 469
Open
Labels
contribution welcomegood first issueWant to contribute to WXT? This is a good place to startWant to contribute to WXT? This is a good place to start
Description
Describe the bug
Setup
// wxt.config.ts
export default defineConfig({
zip: {
includeSources: ['entrypoints/**'],
},
})Repo tree:
entrypoints/foo.ts
entrypoints/bar.js
cache/secrets/abc
super-secret-file
.gitignore
Expected behavior
$ wxt zip:firefox
$ zipinfo .output/*sources.zip
entrypoints/foo.ts
entrypoints/bar.jsCurrent non-intuitive, dangerously leaky behavior
$ wxt zip:firefox
$ zipinfo .output/*sources.zip
entrypoints/foo.ts
entrypoints/bar.js
cache/secrets/abc
super-secret-fileHacky workaroud
I should not have to do this, but that's how I worked around this bug:
export default defineConfig({
zip: {
excludeSources: ['**'],
includeSources: ['entrypoints/**'],
},
})I'll point out that this usually not how an allowlist/denylist behaves. The "accepted", safe, intuitive behavior is the following:
- Nothing configured: default behavior, today "Hidden files, node_modules, and tests are ignored". I'd personally vote for a more advanced "respect .Xignore" support for a bunch of popular VCSes, like what ripgrep does, but that's a stretch.
- Only allowlist provided (include): takes precedence since the user went through the trouble of customizing this setting; only what's "included" is included; not what happens, and what this bug is about.
- Only denlist provided (exclude): takes precedence, everything is included except what's denied.
- Both allowlist & denylist provided: only what passes the allowlist, then filter out further according to denylist. Though I accept that the opposite (first denylist, then force-allowlist), which is WXT's current behavior ("[includeSources] overrides excludeSources; if a file matches both lists, it is included in the ZIP") is acceptable albeit annoying.
Pointers:
- https://wxt.dev/guide/essentials/publishing.html#firefox-addon-store
- https://wxt.dev/api/reference/wxt/interfaces/InlineConfig.html#zip
- Vaguely related: Automatic gathering of used files for
zip#1505
Reproduction
Steps to reproduce
$ mkdir /tmp/repro && cd /tmp/repro
$ unzip /tmp/repro.zip
$ npm install
$ npm run zip:firefox
$ zipinfo .output/*sources.zipSystem Info
System:
OS: Linux 6.18 cpe:/o:nixos:nixos:26.05 26.05 (Yarara)
CPU: irrelevant
Memory: irrelevant
Container: Yes
Shell: 5.3.9 - /bin/bash
Binaries:
Node: 24.13.0 - node
Yarn: 1.22.22 - yarn
npm: 11.6.2 - npm
pnpm: 10.28.0 - pnpm
npmPackages:
wxt: ^0.20.6 => 0.20.13Used Package Manager
pnpm
Validations
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
contribution welcomegood first issueWant to contribute to WXT? This is a good place to startWant to contribute to WXT? This is a good place to start