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.js
Current non-intuitive, dangerously leaky behavior
$ wxt zip:firefox
$ zipinfo .output/*sources.zip
entrypoints/foo.ts
entrypoints/bar.js
cache/secrets/abc
super-secret-file
Hacky 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:
Reproduction
repro.zip
Steps to reproduce
$ mkdir /tmp/repro && cd /tmp/repro
$ unzip /tmp/repro.zip
$ npm install
$ npm run zip:firefox
$ zipinfo .output/*sources.zip
System 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.13
Used Package Manager
pnpm
Validations
Describe the bug
Setup
Repo tree:
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:
I'll point out that this usually not how an allowlist/denylist behaves. The "accepted", safe, intuitive behavior is the following:
Pointers:
zip#1505Reproduction
repro.zip
Steps to reproduce
System 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