-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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 customizing generated file paths for non-HTML files #7808
Comments
Since generating paths seems to happen all over the place in Gatsby, and path generation method is mostly hardcoded, fixing this to be fully customizable would seem to be quite a large rework. However, since all places should respect |
Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open! |
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue. |
Hello! What about this feature? |
Summary
Allow customizing the file paths Gatsby generates for JavaScript, CSS and JSON files.
Basic example
Currently, all non-HTML generated files end up at fixed paths in the built directory.
2-b3d43945f6c7a50aa89b.js
component---src-pages-index-js-d21e28ef0022ceb7ca2f.js
component---src-pages-index-js.13f388f2be065d96ed97.css
webpack-runtime-d38689d008fd7c177cbf.js
webpack.stats.json
static/d/173/path---index-6a9-NZuapzHg3X9TaN1iIixfv1W23E.json
It should be possible to customize these paths, or atleast specify a subdirectory to place these paths in (that is separate from
pathPrefix
which affects the entire site and not just the non-HTML files).Motivation
Having the paths fixed makes it difficult to separate paths generated by Gatsby from other paths that might have to co-exist in the same domain. Compare this with WordPress, for example, where all data (for better or worse) is in
wp-content
orwp-includes
.Using path prefix works if there is only a single subdirectory which should be served by Gatsby, but for example if both
/dev/
and/doc/
should be served by Gatsby, and everything else by something different, then the only solution for now would be to make two separate Gatsby sites with different path prefixes, which is quite non-optimal.The text was updated successfully, but these errors were encountered: