-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disable content-script loader #946
Comments
@mp3por i can see the loader is used to support HMR in dev. I'm not sure why it is in production build Looks like theres no way to disable it. We probably would need to make a PR with the option to do so. Should we go for different dev/prod experience or should we go for an option like a switch? |
@mp3por, I also experienced the same problem. |
It would be great if we could find a way to do content scripts without the loader. PR are welcome! Some background on the dynamic import loader:
Some things to keep in mind:
|
So if they need to behave the same way in dev/build i guess the only option is to use a vite crxjs config switch for including the HMR support or not. useLoader or not |
Is there a way to manually edit this file to avoid this error ? |
In my case I'm injecting conent_scripts updating @crxjs/vite-plugin 2.0.0-beta.19 to ^2.0.0-beta.28 fixed the issue for me. |
Build tool
Rollup
Where do you see the problem?
Describe the bug
At the moment when I run
vite build
I get acontent-script.ts-loader.js
file which looks something like this:Because of this I receive the following error in the browser
I use the following content_script_policy:
How to tell the plugin to not add this
loader
file because i don't need it in production ?Reproduction
asdjioasd
Logs
No response
System Info
Severity
blocking all usage of RPCE
The text was updated successfully, but these errors were encountered: