Closed radarseven closed 6 years ago
Hey @radarseven - you can specify a 'mount' URL for the static files in the public directory, which might solve your problem. For example:
fractal.web.set('static.path', __dirname + '/public');
fractal.web.set('static.mount', '/static');
Now anything in your public directory will be available at a URL that is prefixed by the path (in this example ) /static
. For example, a stylesheet at public/assets/css/foo.css
will now be served at the URL /static/assets/css/foo.css
.
Would that help solve the issue?
Hey @allmarkedup, thanks for the response.
I don't "think" that actually helps me. The reason is, I'm using the public
directory for production-ready builds. So, if I set static.mount
to /static
, then all of my path references in SCSS to those assets, i.e. images, etc. won't work after building to a static export.
Am I thinking about this incorrectly? The only issue I'm running into is that /public/index.html
prevents the server from loading correctly when working locally. Perhaps there's a better way around that issue?
I have same issue @radarseven have you found any solution for that ? My case is that I have js application which is at the end bundlel to /dist folder. With index.html, css/, js/ but when I set public.path to that directory fractal will load dist/index.html as default page 🤔
I've also encountered this problem and would really need a solution. My project setup is nearly identical to @xar and when I set static.path to /dist (to be able to load compiled CSS and JS) it won't work if I also have a index.html file in that folder.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Just an fyi, using mount worked for me :) thank you for this.
Hey Guys,
So, the use case is the following directory setup:
With the following Fractal config:
However, when trying to load the Web UI on
http://localhost:3000
, the file/public/index.html
prevents the Web UI from loading the component library and is loaded instead.I tried modifying
/public/.htacess
withDirectoryIndex index.js index.html
, but no dice. Is there any way around this issue? I assume it had something to do with how the Web UI is being loaded up.