wxt
wxt copied to clipboard
Modified `wxt.config` via `wxt.hook` is reset on dev reloaded
Describe the bug
There is a bug that causes wxt.config
modified via hook to be reset. I'm modifying the outDir
, but the path is broken. The path is correct at startup dev, but the reset when the HMR reloads. This is causing content-script to not reload.
It can be reproduced with the example of separating outDir from dev and prod written in docs - https://wxt.dev/guide/go-further/reusable-modules.html#actually-doing-something.
This is similar to this #863 . Perhaps the cause may be the same.
Reproduction
https://github.com/wxt-dev/wxt/compare/main...1natsu172:repro-weired-ourDir-path
Steps to reproduce
cd packages/wxt-demo
pnpm dev
# save something content-script file.
System Info
System:
OS: macOS 14.6.1
CPU: (8) arm64 Apple M1
Memory: 178.72 MB / 8.00 GB
Shell: 3.7.0 - /opt/homebrew/bin/fish
Binaries:
Node: 22.7.0 - ~/.asdf/installs/nodejs/22.7.0/bin/node
npm: 10.8.2 - ~/.asdf/plugins/nodejs/shims/npm
pnpm: 9.6.0 - ~/.asdf/installs/nodejs/22.7.0/bin/pnpm
bun: 1.1.25 - ~/.asdf/shims/bun
Watchman: 2024.04.22.00 - /opt/homebrew/bin/watchman
Browsers:
Brave Browser: 111.1.49.120
Chrome: 128.0.6613.85
Safari: 17.6
npmPackages:
wxt: workspace:* => 0.19.7
Used Package Manager
pnpm
Validations
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.