Description
Describe the bug
Asking the AI bot about excluding files from zip, I got these instructions:
To exclude all JSON files except manifest.json from the zip, you can configure the zip.exclude option in your wxt.config.ts file as follows:
// wxt.config.ts
import { defineConfig } from 'wxt';
export default defineConfig({
zip: {
exclude: [
'**/*.json', // Exclude all .json files
'!manifest.json', // Include manifest.json
],
},
});
Here's how this configuration works:
'**/*.json' excludes all files with the .json extension in any directory.
'!manifest.json' is a negative pattern that includes manifest.json, overriding the previous exclusion.
Make sure that the paths specified in the exclude array are relative to the root of the WXT project.
However, the bang(!) seems to cause some weirdness when trying to open the produced zip file.
Not sure if I'm doing something wrong, or if there is a bug?
Reproduction
https://github.com/skube/min-repro-wxt
Steps to reproduce
Steps:
npm i
npm run zip
- Try to open
.zip
created in.output/
System Info
System:
OS: macOS 15.3.1
CPU: (8) arm64 Apple M2
Memory: 107.06 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.11.1/bin/yarn
npm: 10.9.2 - ~/.nvm/versions/node/v20.11.1/bin/npm
pnpm: 9.12.2 - ~/.nvm/versions/node/v20.11.1/bin/pnpm
bun: 1.2.2 - ~/.bun/bin/bun
Browsers:
Chrome: 133.0.6943.142
Edge: 118.0.2088.76
Safari: 18.3
npmPackages:
wxt: ^0.19.29 => 0.19.29
Used Package Manager
npm
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.