Path to static resources is baked in, cannot be set when using as a module
See original GitHub issueWhen using the GUI as a node module in another project, you should be able to specify where to find static assets like images. Right now they are baked with /static/assets/...
which works for www but makes it hard to use in other projects where those files might have a different path.
/cc @rschamp part of using GUI as a component of other projects
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Files in static cannot be accessible in both local development ...
base and paths.assets are configured and the app is baked to a static site using the static adapter, this HTML will work because...
Read more >Can't serve static files using express.Router? - Stack Overflow
From the express docs. the path that you provide to the express.static function is relative to the directory from where you launch your...
Read more >Serve Static Resources with Spring - Baeldung
2. Using Spring Boot ... Spring Boot comes with a pre-configured implementation of ResourceHttpRequestHandler to facilitate serving static ...
Read more >IIS and ASP.NET Core Rewrite Rules for Static Files and Html ...
Note that I leave the AspNetCore module path at * to allow anything not captured by the static file module mappings to still...
Read more >How to manage static files (e.g. images, JavaScript, CSS)
In your templates, use the static template tag to build the URL for the given relative path using the configured STATICFILES_STORAGE .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure what the best way to solve this is for the distributable module, but for our purposes in the short term the plan should be to inline loaders and point
main
(or justbrowser
) tosrc/
so that the gui can be built by an external webpack config. Then the containing project can configure publicPath itself.Setting
__webpack_public_path__
would work if we were building different versions of gui. Unfortunately, we’re building a consumer of gui (i.e. www and desktop), and the version of gui they use is already built (dist) and the static path for assets is already set. So the real solution is to usesrc/index.js
as a browser entry point and let the consumer projects configure the static path and build gui as mentioned by @rschamp above. However, that would be a pretty big change for scratch-www, so for now the workaround is https://github.com/LLK/scratch-gui/pull/4646