Replies: 1 comment
-
This is intentional choice and is required for a fast dev experience. IMO, the trade-off between DX and consistency is worth it, so I wrote WXT with that in mind. You need to test production builds of your extension before publishing, adding E2E tests can help with that: https://wxt.dev/get-started/testing.html One thing you didn't mention was the permissions. Dev mode adds a few normal |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here you can reproduce the problem using the official example.
In the index.tsx file, matches is used to declare the injection of content scripts in the
'*://*/*'
page. When the dev script is run, the host_permissions permission declaration"host_permissions": ["*://*/*", "http://localhost/*"]
appears in the generated manifest file. However, when the build or zip script is run, there is no such declaration in the generated manifest file. This leads to inconsistent behavior in the output of the dev script and the build script. For example, I used the webRequest API and there was no problem testing in dev mode, but it did not work in build mode. There is no error here. I found the problem after comparing the output of the dev and build scripts and reading the documentation of the chrome extension. This may be mainly my personal problem. I didn't know that I needed to declare the host_permissions permission to use the webRequest API. If someone encounters the same problem as me, this may be the reason.Beta Was this translation helpful? Give feedback.
All reactions