Skip to content
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

Can not HMR an web-accessible-resources #897

Open
coolcorexix opened this issue Jun 20, 2024 · 1 comment
Open

Can not HMR an web-accessible-resources #897

coolcorexix opened this issue Jun 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@coolcorexix
Copy link

Describe the problem

I have this script that have to be attached as script element on host page because I need to register a global component (which can not be done by running the script in the content script). But the script have ReactJs in it so it need to be bundled with vite so that the browser can understand.

Currently I can not get the file to be HMR during development so I have to go through this painful manual procedure instead:

  • Make change to the script
  • Run a vite build command separately
  • Update the output file path mentioned in the manifest.json

Have CRXJS already supported this without me knowing?

Describe the proposed solution

If possible, please give me the ability to HMR with specified web_resources by registering them in the vite.config.ts

{
...
build: {
rollupOptions: {
input: {
newAlias: "same_path_in_the_manifest"
}
}
}
}

Alternatives considered

I am considering making a separate HMR server while waiting for our discussion

Importance

would make my life easier

@coolcorexix coolcorexix added the enhancement New feature or request label Jun 20, 2024
@Toumash
Copy link

Toumash commented Jun 29, 2024

Its just a content script in MAIN world.
Some work done here #851 and here #695.
Current state explained in the blogpost https://dev.to/jacksteamdev/advanced-config-for-rpce-3966 in the "main world scrips" chapter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants