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

Live updates without running build or reloading from "browser://extensions" #5

Open
FireMakeThunder opened this issue Dec 18, 2021 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@FireMakeThunder
Copy link

FireMakeThunder commented Dec 18, 2021

Are you aware of or do you implement any methods that keep the extension updated, while developing, akin to how the development server works?

Asked differently: how would one test changes to things like content_scripts, background scripts and other code that uses the extension APIs, without "run build" and then reloading the extension from the browser extensions page?

Using the dev server works for everything except code that uses the browser extension API's, and for that, currently, I run build and then reload the extension from the browser's extension page, which is slow.

@paolodina
Copy link

For reloading the extension from the browser quickly this should do the trick ("A chrome extension for reloading unpacked extensions")

@FireMakeThunder
Copy link
Author

FireMakeThunder commented Feb 27, 2022

That would help with building, thank you for that share.

Here are two ideas for this issue:

  • There is a method to use an extension reloader like mention, and have an npm run dev like experience. Such a tool would compliment this adapter, and there is an example with React/Webpack on this website: https://smellycode.com/chrome-extension-live-reloading-with-react/
  • Second, if you save scripts/html in the static directory, such as content/background scripts, it is a hassle to run build in order to copy from static to the root of build. Is it less practical for this adapter to instead copy into build/static, which then allows you to run a script refresh build/static and avoid the slower Vite build process? Much faster than running build to update your static scripts.

@antony
Copy link
Owner

antony commented Mar 8, 2022

This definitely sounds desirable, I've been doing it manually so far, but if anybody wants to have a go at making it more automated, that would be great.

As for static scripts - there might be a way to hook into vite so that it can do this process for you rather than relying on build, but I haven't looked into it.

@antony antony added the help wanted Extra attention is needed label Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants