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

Allow to generate non-html files to a subfolder(s) #5270

Closed
szimek opened this issue May 4, 2018 · 4 comments
Closed

Allow to generate non-html files to a subfolder(s) #5270

szimek opened this issue May 4, 2018 · 4 comments

Comments

@szimek
Copy link
Contributor

szimek commented May 4, 2018

Gatsby generates all non-html files (e.g. *.js files, styles.css and chunk-manifest.json etc.) directly into public folder. However, there are some cases where it would be convenient to generate them into a subfolder, or subfolders.

I explained my use case in detail here: #2335 (comment), but the gist is that if one has more than one app available at the same path, e.g. /, it would make it much easier to write proxy rules for Gatsby apps, if all html files were e.g. at /:locale/blog/ and all non-html assets were at /blog-assets/, instead of /.

There's already a similar ticket #2335.

An alternative is to use pathPrefix option, but, at least in my case, it complicates things a lot and not everything works with it correctly, e.g. serve command etc.

@m-allanson
Copy link
Contributor

@szimek would this issue solve your problem, or does it only solve part of it? #3760

@m-allanson
Copy link
Contributor

Also linking #5271 as it's mentioned above.

@szimek
Copy link
Contributor Author

szimek commented May 9, 2018

@m-allanson It does solve my issue, if I can select name of the folder in which all non-html files end up. If Gatsby new folder structure ends up like public/js, public/css etc. it doesn't help me much if I want to have more than one Gatsby app, because if I have e.g. a blog app at /:locale/blog and other app at /:locale/hub, then both apps will generate their js files in /js/ and I still can't easily figure out which app should handle which request.

If I can set it up, so that all non-html files for the blog app end up e.g. in its own public/blog-assets and for the other app app in its own public/hub-assets and everything in Gatsby is aware of it, then I can create server rules that proxy all requests to /blog-assets/*.* to the blog app and /hub-assets/*.* to the other app.

If that's what #3760 is proposing, then this ticket can be closed as a duplicate.

@KyleAMathews
Copy link
Contributor

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants