Comments (3)
Great tip, that did it! @cezaraugusto I've tested and submitted a PR for here and updated docs, linked above.
from extension.
Hi there! Thanks!
If you are trying to load a source (not bundled) file in scripts/
and you get a $RefreshSig$ is not defined
, that's a bug.
However if this file is bundled somewhere else outside Extension.js
(like you said -- separately building and including in your extension), then scripts/
will fail if there are variables and imports outside the scope, as it has no access to the external bundling system. In this case, adding them to public/
might be the right choice. However, since it was designed for static assets, it does not listen for file changes.
I think having public/
to listen to file changes wouldn't affect existing functionality, but this is currently far from priorities. If you're feeling adventurous, editing the CopyPublicFolder file is the alternative for handling reload of public/
assets. I theorize that adding a listener to the change
event in there would make your request possible. Something like:
watcher.on('change', (filePath: string) => {
const target = path.join(output, path.relative(projectPath, filePath))
this.copyFile(filePath, target)
})
The manual test would be adding a file to public/
and asserting that Extension.js reloads if they change. I added some instructions to run the project locally in CONTRIBUTING.md. If you want to give it a go, I can definitely review.
from extension.
Fixed by #64
from extension.
Related Issues (20)
- CompatPlugin should handle wrong web_accessible_resources
- CompatPlugin should handle deprecated fields
- Unable to run; erroneously claims address 127.0.0.1:8000 is in use HOT 1
- Support global installs
- Support Safari using Xcode's safari-web-extension-converter HOT 1
- Support for template composition HOT 1
- Shadow DOM powered Content Scripts UI HOT 3
- Error: Cannot find module 'webpack-run-edge-extension' HOT 1
- Is there a plan to support Vue? HOT 4
- Update command example on getting started page. HOT 3
- Add option to initialize git along with the project HOT 3
- How to include polyfills for node apis? HOT 3
- Can extension.js add some common utility methods? HOT 1
- Consider custom support for authentication
- Allow to develop on any Chromium-based Browser HOT 1
- Feature: Outlook extension HOT 3
- Setting the execution environment for content script to `MAIN` throws an error
- Could not resolve path ./scripts/content.js. Either add it to the "public" directory or create a script in the "scripts" directory.
- Custom Tailwindcss theme with Extension.js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from extension.