Giter VIP home page Giter VIP logo

Comments (3)

mattvr avatar mattvr commented on June 3, 2024 1

Great tip, that did it! @cezaraugusto I've tested and submitted a PR for here and updated docs, linked above.

from extension.

cezaraugusto avatar cezaraugusto commented on June 3, 2024

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.

cezaraugusto avatar cezaraugusto commented on June 3, 2024

Fixed by #64

from extension.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.