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

Regroup non-static files into a public's subdirectory #3760

Closed
monsieurnebo opened this issue Jan 29, 2018 · 16 comments
Closed

Regroup non-static files into a public's subdirectory #3760

monsieurnebo opened this issue Jan 29, 2018 · 16 comments
Labels
help wanted Issue with a clear description that the community can help with.

Comments

@monsieurnebo
Copy link
Contributor

The idea

It would be useful to regroup all the non-static files of the build into a subdirectory of /public/.

Something like:

|-public/
  |- static/
    |- header.jpg
    |- comicSansMs.ttf
    |- ...
  |- res/
    |- about/
    |- contact/
    |- component---src-pages-about-....
    |- component---src-pages-contact-....
    |- path---about-...
    |- path---contact...
    |- styles.css
    |- ...

Where /res/ would be the directory, that's a placeholder name.

Why ?

You can have some situation where GatsbyJS's files aren't the only files on the hosting root. If you need to apply any operation on the Gatsby's files, it's a pain to target them and not other files. You have to look for:

  • All the page folders
  • app-... files
  • commons-... files
  • component--- ... files
  • path---... files
  • styles.css file
  • And more...

We quickly can have something like 40 files to manage.

In our case, we want to invalidate the Cloudfront cache of Gatsby's files (on only them), and without the ability of using regex, it's a real pain...

It could be an interesting feature for v2 (along the ability of choosing the public directory name) :)

@calcsam
Copy link
Contributor

calcsam commented Feb 4, 2018

It seems like the ability to choose the output folder would be sufficient, no? You could choose public/res as the folder.

Going to close this in favor of #1878

@calcsam calcsam closed this as completed Feb 4, 2018
@m-allanson
Copy link
Contributor

m-allanson commented Feb 4, 2018

@calcsam I think this request is slightly different. If I understand @monsieurnebo (please correct me if I have this wrong!), the aim is for Gatsby to be a bit neater with how it populates the public/ directory. So the name public/ is irrelevant, this is about how the contents of the directory are structured.

Moving all of Gatsby's auto-generated files into a subdirectory means that:

  • it's easier to post-process Gatsby's build output
  • it's easier to understand the result of Gatsby's build step

Here's an example using the build output for gatsbyjs.org with a new directory ___gatsby/ for storing static assets and Gatsby-specific files.

Current `public/` directory for gatsbyjs.org
404/
404.html
README/
_headers
android-chrome-192x192.png
android-chrome-512x512.png
app-15fb508b5ef6c1970184.js
app-15fb508b5ef6c1970184.js.map
apple-touch-icon.png
blog/
browserconfig.xml
build-js-styles.css
build-js-styles.css.map
chunk-manifest.json
code-of-conduct/
colors/
commons-a06bf33d08016fb9d441.js
commons-a06bf33d08016fb9d441.js.map
community/
component---node-modules-gatsby-plugin-offline-app-shell-js-5c4c5a0f7af9dc69d6d7.js
component---node-modules-gatsby-plugin-offline-app-shell-js-5c4c5a0f7af9dc69d6d7.js.map
component---src-layouts-index-js-e196ab099460a665a413.js
component---src-layouts-index-js-e196ab099460a665a413.js.map
component---src-pages-404-js-bdb0d328929deca12382.js
component---src-pages-404-js-bdb0d328929deca12382.js.map
component---src-pages-blog-index-js-63ffe198bf87868aba65.js
component---src-pages-blog-index-js-63ffe198bf87868aba65.js.map
component---src-pages-colors-js-11806e10f232e9395fb4.js
component---src-pages-colors-js-11806e10f232e9395fb4.js.map
component---src-pages-docs-bound-action-creators-js-1b9add371154acfd7d30.js
component---src-pages-docs-bound-action-creators-js-1b9add371154acfd7d30.js.map
component---src-pages-docs-browser-apis-js-90304ad038f10e42a532.js
component---src-pages-docs-browser-apis-js-90304ad038f10e42a532.js.map
component---src-pages-docs-index-js-78c3a00fb38277cb68bb.js
component---src-pages-docs-index-js-78c3a00fb38277cb68bb.js.map
component---src-pages-docs-node-apis-js-8540b08d996ae9a3b086.js
component---src-pages-docs-node-apis-js-8540b08d996ae9a3b086.js.map
component---src-pages-docs-ssr-apis-js-8bc2b038dcea27f61b2d.js
component---src-pages-docs-ssr-apis-js-8bc2b038dcea27f61b2d.js.map
component---src-pages-features-js-0cd11a286c4c9d82cbaf.js
component---src-pages-features-js-0cd11a286c4c9d82cbaf.js.map
component---src-pages-index-js-4281ff0e6766d6fc461a.js
component---src-pages-index-js-4281ff0e6766d6fc461a.js.map
component---src-pages-tutorial-js-04648eda326ddfde6629.js
component---src-pages-tutorial-js-04648eda326ddfde6629.js.map
component---src-templates-template-blog-post-js-69e73f18c1f96dd003f3.js
component---src-templates-template-blog-post-js-69e73f18c1f96dd003f3.js.map
component---src-templates-template-contributor-page-js-5c67a4ceacd18eaa9d57.js
component---src-templates-template-contributor-page-js-5c67a4ceacd18eaa9d57.js.map
component---src-templates-template-docs-markdown-js-48670fd55749292c2073.js
component---src-templates-template-docs-markdown-js-48670fd55749292c2073.js.map
component---src-templates-template-docs-packages-js-37a261dbeabdf002ce83.js
component---src-templates-template-docs-packages-js-37a261dbeabdf002ce83.js.map
contributors/
docs/
favicon-16x16.png
favicon-32x32.png
favicon.ico
features/
gatsbygram.mp4
graphiql-explore.mp4
images/
index.html
manifest.json
monogram.svg
mstile-150x150.png
offline-plugin-app-shell-fallback/
packages/
path----557518bd178906f8d58a.js
path----557518bd178906f8d58a.js.map
path---404-a0e39f21c11f6a62c5ab.js
path---404-a0e39f21c11f6a62c5ab.js.map
path---404-html-a0e39f21c11f6a62c5ab.js
path---404-html-a0e39f21c11f6a62c5ab.js.map
path---blog-0032d9527b19b65679a1.js
path---blog-0032d9527b19b65679a1.js.map
path---blog-2017-07-19-creating-a-blog-with-gatsby-0367fcfbc4214cff2c97.js
path---blog-2017-07-19-creating-a-blog-with-gatsby-0367fcfbc4214cff2c97.js.map
path---blog-2017-09-13-why-is-gatsby-so-fast-1ab885f0a254257ce219.js
path---blog-2017-09-13-why-is-gatsby-so-fast-1ab885f0a254257ce219.js.map
path---blog-2017-09-18-gatsby-modern-static-generation-f1592a0eb2df07e91248.js
path---blog-2017-09-18-gatsby-modern-static-generation-f1592a0eb2df07e91248.js.map
path---blog-2017-09-21-community-roundup-1-cc768fd2adb013eb8553.js
path---blog-2017-09-21-community-roundup-1-cc768fd2adb013eb8553.js.map
path---blog-2017-09-26-embracing-graphql-423378457330ab0c20ab.js
path---blog-2017-09-26-embracing-graphql-423378457330ab0c20ab.js.map
path---blog-2017-10-01-migrating-my-blog-from-hexo-to-gatsby-69d3153e05e0ba1f321e.js
path---blog-2017-10-01-migrating-my-blog-from-hexo-to-gatsby-69d3153e05e0ba1f321e.js.map
path---blog-2017-10-03-smartive-goes-gatsby-322fba0fcaf1add23902.js
path---blog-2017-10-03-smartive-goes-gatsby-322fba0fcaf1add23902.js.map
path---blog-2017-10-05-portfolio-site-gatsby-wordpress-d1641a866aac75e18de1.js
path---blog-2017-10-05-portfolio-site-gatsby-wordpress-d1641a866aac75e18de1.js.map
path---blog-2017-10-16-making-website-building-fun-32fe7ef03771a953fa1a.js
path---blog-2017-10-16-making-website-building-fun-32fe7ef03771a953fa1a.js.map
path---blog-2017-10-17-building-i-18-n-with-gatsby-2a29e36c43ccd3d1c19c.js
path---blog-2017-10-17-building-i-18-n-with-gatsby-2a29e36c43ccd3d1c19c.js.map
path---blog-2017-10-20-from-wordpress-to-developing-in-react-starting-to-see-it-2dcc47042c932b10cd0a.js
path---blog-2017-10-20-from-wordpress-to-developing-in-react-starting-to-see-it-2dcc47042c932b10cd0a.js.map
path---blog-2017-10-29-my-search-for-the-perfect-universal-java-script-framework-3e7cd3833bab8c2ac5eb.js
path---blog-2017-10-29-my-search-for-the-perfect-universal-java-script-framework-3e7cd3833bab8c2ac5eb.js.map
path---blog-2017-11-06-migrate-hugo-gatsby-c2e1ed3a340a8dbbd81a.js
path---blog-2017-11-06-migrate-hugo-gatsby-c2e1ed3a340a8dbbd81a.js.map
path---blog-2017-11-08-migrate-from-jekyll-to-gatsby-34aa4c027046513bcc41.js
path---blog-2017-11-08-migrate-from-jekyll-to-gatsby-34aa4c027046513bcc41.js.map
path---blog-2017-11-09-why-i-created-my-blog-with-gatsby-and-contentful-8e1b227ea0c05a47f554.js
path---blog-2017-11-09-why-i-created-my-blog-with-gatsby-and-contentful-8e1b227ea0c05a47f554.js.map
path---blog-2017-12-06-gatsby-plus-contentful-plus-netlify-7fc717171e45a17441ca.js
path---blog-2017-12-06-gatsby-plus-contentful-plus-netlify-7fc717171e45a17441ca.js.map
path---blog-2017-12-07-taking-gatsby-for-a-spin-87aa014a8b8b2ac0caa3.js
path---blog-2017-12-07-taking-gatsby-for-a-spin-87aa014a8b8b2ac0caa3.js.map
path---blog-2017-12-20-introducing-the-gatsby-ux-research-program-0d91f01e858c9e15ecff.js
path---blog-2017-12-20-introducing-the-gatsby-ux-research-program-0d91f01e858c9e15ecff.js.map
path---blog-2018-01-18-how-boston-gov-used-gatsby-to-be-selected-as-an-amazon-hq-2-candidate-city-32900d22f1d4fbb3e1d1.js
path---blog-2018-01-18-how-boston-gov-used-gatsby-to-be-selected-as-an-amazon-hq-2-candidate-city-32900d22f1d4fbb3e1d1.js.map
path---blog-2018-01-22-getting-started-gatsby-and-wordpress-712bc0af1a19ff7ff2ba.js
path---blog-2018-01-22-getting-started-gatsby-and-wordpress-712bc0af1a19ff7ff2ba.js.map
path---blog-2018-1-18-strapi-and-gatsby-4ed7de49e7774598f6cd.js
path---blog-2018-1-18-strapi-and-gatsby-4ed7de49e7774598f6cd.js.map
path---blog-2018-1-24-creative-software-destruction-new-presentation-layer-111b8f332d0d97094a86.js
path---blog-2018-1-24-creative-software-destruction-new-presentation-layer-111b8f332d0d97094a86.js.map
path---blog-2018-1-25-building-a-site-with-react-and-contentful-0356f38d757795e6baeb.js
path---blog-2018-1-25-building-a-site-with-react-and-contentful-0356f38d757795e6baeb.js.map
path---blog-gatsby-first-beta-release-4599ede5f8cadd099fb1.js
path---blog-gatsby-first-beta-release-4599ede5f8cadd099fb1.js.map
path---blog-gatsby-v-1-10e2ff6faa5ea9e8fcd2.js
path---blog-gatsby-v-1-10e2ff6faa5ea9e8fcd2.js.map
path---blog-gatsbygram-case-study-083ab3574039041260c1.js
path---blog-gatsbygram-case-study-083ab3574039041260c1.js.map
path---code-of-conduct-d093e02931e77abb45ac.js
path---code-of-conduct-d093e02931e77abb45ac.js.map
path---colors-a0e39f21c11f6a62c5ab.js
path---colors-a0e39f21c11f6a62c5ab.js.map
path---community-47daf2953c6eb3ba5a31.js
path---community-47daf2953c6eb3ba5a31.js.map
path---contributors-amberley-romo-bf45a437e9f5145d886f.js
path---contributors-amberley-romo-bf45a437e9f5145d886f.js.map
path---contributors-arden-de-raaij-fe8dd7fb124513fea8b2.js
path---contributors-arden-de-raaij-fe8dd7fb124513fea8b2.js.map
path---contributors-benjamin-read-52b75824e1a56066ece0.js
path---contributors-benjamin-read-52b75824e1a56066ece0.js.map
path---contributors-david-james-e60a401e0bdf8d2d35d5.js
path---contributors-david-james-e60a401e0bdf8d2d35d5.js.map
path---contributors-dustin-schau-ad84617b1897bd71e1f4.js
path---contributors-dustin-schau-ad84617b1897bd71e1f4.js.map
path---contributors-fernando-poumian-2953e9ef1941007f07ec.js
path---contributors-fernando-poumian-2953e9ef1941007f07ec.js.map
path---contributors-ian-sinnott-a8e325689d19320106a4.js
path---contributors-ian-sinnott-a8e325689d19320106a4.js.map
path---contributors-josh-weaver-1664ec504b013b0bf5b1.js
path---contributors-josh-weaver-1664ec504b013b0bf5b1.js.map
path---contributors-kalin-chernev-01bb788309530394d38c.js
path---contributors-kalin-chernev-01bb788309530394d38c.js.map
path---contributors-kostas-bariotis-9772d373f262fcf845f4.js
path---contributors-kostas-bariotis-9772d373f262fcf845f4.js.map
path---contributors-kyle-mathews-3e5034d8ac1bf9612c93.js
path---contributors-kyle-mathews-3e5034d8ac1bf9612c93.js.map
path---contributors-moreno-feltscher-94954192821e14821c0b.js
path---contributors-moreno-feltscher-94954192821e14821c0b.js.map
path---contributors-nahuel-scotti-7964f8e566d7971b5f8d.js
path---contributors-nahuel-scotti-7964f8e566d7971b5f8d.js.map
path---contributors-pierre-burgy-435267902ab064b4bd1e.js
path---contributors-pierre-burgy-435267902ab064b4bd1e.js.map
path---contributors-robin-vasan-dbb6ed631404c84f57b6.js
path---contributors-robin-vasan-dbb6ed631404c84f57b6.js.map
path---contributors-sam-bhagwat-9e186f90b18102e52115.js
path---contributors-sam-bhagwat-9e186f90b18102e52115.js.map
path---contributors-samuel-goudie-7fa732a52ecebe27c2d9.js
path---contributors-samuel-goudie-7fa732a52ecebe27c2d9.js.map
path---contributors-shannon-soper-5916c9e642d140fa263c.js
path---contributors-shannon-soper-5916c9e642d140fa263c.js.map
path---contributors-tal-bereznitskey-6bfd97edd575807b8081.js
path---contributors-tal-bereznitskey-6bfd97edd575807b8081.js.map
path---contributors-tim-arney-31e62224a3a7d6336378.js
path---contributors-tim-arney-31e62224a3a7d6336378.js.map
path---docs-a0e39f21c11f6a62c5ab.js
path---docs-a0e39f21c11f6a62c5ab.js.map
path---docs-add-404-page-8404bd49b453d4a11d76.js
path---docs-add-404-page-8404bd49b453d4a11d76.js.map
path---docs-add-custom-webpack-config-d6a6dc1acec12683bd0c.js
path---docs-add-custom-webpack-config-d6a6dc1acec12683bd0c.js.map
path---docs-adding-a-list-of-markdown-blog-posts-410c3964152c8e390de7.js
path---docs-adding-a-list-of-markdown-blog-posts-410c3964152c8e390de7.js.map
path---docs-adding-images-fonts-files-26d17ac4c3e20c48929a.js
path---docs-adding-images-fonts-files-26d17ac4c3e20c48929a.js.map
path---docs-adding-markdown-pages-eddf03cdf9cebff93e75.js
path---docs-adding-markdown-pages-eddf03cdf9cebff93e75.js.map
path---docs-adding-tags-and-categories-to-blog-posts-5d5f812f21b340c6c1fd.js
path---docs-adding-tags-and-categories-to-blog-posts-5d5f812f21b340c6c1fd.js.map
path---docs-api-proxy-51be376b98015336e674.js
path---docs-api-proxy-51be376b98015336e674.js.map
path---docs-api-specification-1ccdb823490e7d7f75dd.js
path---docs-api-specification-1ccdb823490e7d7f75dd.js.map
path---docs-awesome-gatsby-9199cbd5b1b0b207d2b0.js
path---docs-awesome-gatsby-9199cbd5b1b0b207d2b0.js.map
path---docs-bound-action-creators-b14be9b041d392772ff1.js
path---docs-bound-action-creators-b14be9b041d392772ff1.js.map
path---docs-browser-apis-3e7edab5cb1dea279bba.js
path---docs-browser-apis-3e7edab5cb1dea279bba.js.map
path---docs-browser-support-5b108ce82f5be6cfa05d.js
path---docs-browser-support-5b108ce82f5be6cfa05d.js.map
path---docs-building-apps-with-gatsby-c3997d59ee72edf408f6.js
path---docs-building-apps-with-gatsby-c3997d59ee72edf408f6.js.map
path---docs-building-with-components-8f6ef9ecada89828a08d.js
path---docs-building-with-components-8f6ef9ecada89828a08d.js.map
path---docs-caching-f365ca7c72039db3bed0.js
path---docs-caching-f365ca7c72039db3bed0.js.map
path---docs-create-source-plugin-fd6e32efcce731c0206a.js
path---docs-create-source-plugin-fd6e32efcce731c0206a.js.map
path---docs-creating-and-modifying-pages-52168ba8b19a4091372b.js
path---docs-creating-and-modifying-pages-52168ba8b19a4091372b.js.map
path---docs-creating-dynamically-rendered-navigation-e750fcb28286f3c8afe5.js
path---docs-creating-dynamically-rendered-navigation-e750fcb28286f3c8afe5.js.map
path---docs-custom-html-98fdd8b6f2df35e84f61.js
path---docs-custom-html-98fdd8b6f2df35e84f61.js.map
path---docs-debugging-html-builds-8e946a430855d4ef2d2a.js
path---docs-debugging-html-builds-8e946a430855d4ef2d2a.js.map
path---docs-deploy-gatsby-ab277c330cb632ae206d.js
path---docs-deploy-gatsby-ab277c330cb632ae206d.js.map
path---docs-design-principles-52b223d4a489c602de95.js
path---docs-design-principles-52b223d4a489c602de95.js.map
path---docs-dropping-images-into-static-folders-96ac2000a9fe065a1260.js
path---docs-dropping-images-into-static-folders-96ac2000a9fe065a1260.js.map
path---docs-environment-variables-2d79f274165c1de7f45f.js
path---docs-environment-variables-2d79f274165c1de7f45f.js.map
path---docs-gatsby-config-bfb1e30b8d04b0fc4b9d.js
path---docs-gatsby-config-bfb1e30b8d04b0fc4b9d.js.map
path---docs-gatsby-lifecycle-apis-61520b8538e88533ff82.js
path---docs-gatsby-lifecycle-apis-61520b8538e88533ff82.js.map
path---docs-gatsby-on-windows-cef0a67c09747feeca55.js
path---docs-gatsby-on-windows-cef0a67c09747feeca55.js.map
path---docs-gatsby-starters-d47aad653eaa0715a0d6.js
path---docs-gatsby-starters-d47aad653eaa0715a0d6.js.map
path---docs-gatsby-style-guide-e3fae7419c203648aeff.js
path---docs-gatsby-style-guide-e3fae7419c203648aeff.js.map
path---docs-glamor-9f2ff497c48856d69906.js
path---docs-glamor-9f2ff497c48856d69906.js.map
path---docs-graphql-reference-11b4983f18c130089cac.js
path---docs-graphql-reference-11b4983f18c130089cac.js.map
path---docs-how-gatsby-works-with-github-pages-5305b3f739097b2a383a.js
path---docs-how-gatsby-works-with-github-pages-5305b3f739097b2a383a.js.map
path---docs-how-to-contribute-b76b863d127734b512de.js
path---docs-how-to-contribute-b76b863d127734b512de.js.map
path---docs-migrating-from-v-0-to-v-1-83ea973b35851b2f1cf8.js
path---docs-migrating-from-v-0-to-v-1-83ea973b35851b2f1cf8.js.map
path---docs-netlify-cms-b245387e377b90d9f2e3.js
path---docs-netlify-cms-b245387e377b90d9f2e3.js.map
path---docs-node-apis-0df8c29bbf831014b74d.js
path---docs-node-apis-0df8c29bbf831014b74d.js.map
path---docs-node-interface-9013dce73a37b78e83fc.js
path---docs-node-interface-9013dce73a37b78e83fc.js.map
path---docs-path-prefix-daeeea992ec62c55b68b.js
path---docs-path-prefix-daeeea992ec62c55b68b.js.map
path---docs-plugins-2ea6df7bff2612a570d3.js
path---docs-plugins-2ea6df7bff2612a570d3.js.map
path---docs-prpl-pattern-d94a44423a232cac10cf.js
path---docs-prpl-pattern-d94a44423a232cac10cf.js.map
path---docs-querying-with-graphql-6a5e0e31625177dbeefc.js
path---docs-querying-with-graphql-6a5e0e31625177dbeefc.js.map
path---docs-ssr-apis-86f3242d27ab17b74309.js
path---docs-ssr-apis-86f3242d27ab17b74309.js.map
path---docs-styled-components-6eecedb1746280c734a9.js
path---docs-styled-components-6eecedb1746280c734a9.js.map
path---docs-themes-711ee9686a9d15fff52f.js
path---docs-themes-711ee9686a9d15fff52f.js.map
path---docs-thinking-in-gatsby-3cc269bae104bd81b980.js
path---docs-thinking-in-gatsby-3cc269bae104bd81b980.js.map
path---features-fbcf917a01bca6149ed1.js
path---features-fbcf917a01bca6149ed1.js.map
path---index-3a1d25dd1706b882ee9b.js
path---index-3a1d25dd1706b882ee9b.js.map
path---offline-plugin-app-shell-fallback-a0e39f21c11f6a62c5ab.js
path---offline-plugin-app-shell-fallback-a0e39f21c11f6a62c5ab.js.map
path---packages-gatsby-1-config-css-modules-99a8c8dcbe6c85ff561b.js
path---packages-gatsby-1-config-css-modules-99a8c8dcbe6c85ff561b.js.map
path---packages-gatsby-9f9ba2c9e4cb198ee770.js
path---packages-gatsby-9f9ba2c9e4cb198ee770.js.map
path---packages-gatsby-cli-4e7adb36a622c2100013.js
path---packages-gatsby-cli-4e7adb36a622c2100013.js.map
path---packages-gatsby-dev-cli-90974a2b08f0b81a89c1.js
path---packages-gatsby-dev-cli-90974a2b08f0b81a89c1.js.map
path---packages-gatsby-image-d1c57c53da2188fc1842.js
path---packages-gatsby-image-d1c57c53da2188fc1842.js.map
path---packages-gatsby-link-57212e4739b9f9e253ca.js
path---packages-gatsby-link-57212e4739b9f9e253ca.js.map
path---packages-gatsby-module-loader-fe08a9bb906bdfdce810.js
path---packages-gatsby-module-loader-fe08a9bb906bdfdce810.js.map
path---packages-gatsby-plugin-aphrodite-ee9636a7997216fadfb2.js
path---packages-gatsby-plugin-aphrodite-ee9636a7997216fadfb2.js.map
path---packages-gatsby-plugin-canonical-urls-312179eb0f4a438721c2.js
path---packages-gatsby-plugin-canonical-urls-312179eb0f4a438721c2.js.map
path---packages-gatsby-plugin-catch-links-f4804080155eb91ef863.js
path---packages-gatsby-plugin-catch-links-f4804080155eb91ef863.js.map
path---packages-gatsby-plugin-coffeescript-fef497f64f213821d408.js
path---packages-gatsby-plugin-coffeescript-fef497f64f213821d408.js.map
path---packages-gatsby-plugin-create-client-paths-44d2c568f5642cb9fa1d.js
path---packages-gatsby-plugin-create-client-paths-44d2c568f5642cb9fa1d.js.map
path---packages-gatsby-plugin-cxs-2e86f577f06c2b82e28e.js
path---packages-gatsby-plugin-cxs-2e86f577f06c2b82e28e.js.map
path---packages-gatsby-plugin-emotion-aa66232a3cb25faedb6b.js
path---packages-gatsby-plugin-emotion-aa66232a3cb25faedb6b.js.map
path---packages-gatsby-plugin-feed-bf14df8367c785f14513.js
path---packages-gatsby-plugin-feed-bf14df8367c785f14513.js.map
path---packages-gatsby-plugin-glamor-e7f13f304052e4154035.js
path---packages-gatsby-plugin-glamor-e7f13f304052e4154035.js.map
path---packages-gatsby-plugin-glamorous-f02bbc4333da80887570.js
path---packages-gatsby-plugin-glamorous-f02bbc4333da80887570.js.map
path---packages-gatsby-plugin-google-analytics-153ab3c86bffdae51219.js
path---packages-gatsby-plugin-google-analytics-153ab3c86bffdae51219.js.map
path---packages-gatsby-plugin-google-tagmanager-4af556f8db532a1535ba.js
path---packages-gatsby-plugin-google-tagmanager-4af556f8db532a1535ba.js.map
path---packages-gatsby-plugin-jss-e088f636dd7354feeb19.js
path---packages-gatsby-plugin-jss-e088f636dd7354feeb19.js.map
path---packages-gatsby-plugin-less-60d940d23597da3a4c94.js
path---packages-gatsby-plugin-less-60d940d23597da3a4c94.js.map
path---packages-gatsby-plugin-lodash-ae831a309cfeffb5b9a8.js
path---packages-gatsby-plugin-lodash-ae831a309cfeffb5b9a8.js.map
path---packages-gatsby-plugin-manifest-af73b9173a6da3272a7f.js
path---packages-gatsby-plugin-manifest-af73b9173a6da3272a7f.js.map
path---packages-gatsby-plugin-netlify-02e7ed37fdb497f46541.js
path---packages-gatsby-plugin-netlify-02e7ed37fdb497f46541.js.map
path---packages-gatsby-plugin-netlify-cms-0f2e208da0d00a9b2c37.js
path---packages-gatsby-plugin-netlify-cms-0f2e208da0d00a9b2c37.js.map
path---packages-gatsby-plugin-no-sourcemaps-c7461e1810a9b397cfb4.js
path---packages-gatsby-plugin-no-sourcemaps-c7461e1810a9b397cfb4.js.map
path---packages-gatsby-plugin-nprogress-0c2eea26d5f55ed5c689.js
path---packages-gatsby-plugin-nprogress-0c2eea26d5f55ed5c689.js.map
path---packages-gatsby-plugin-offline-204bbe22742182397cfc.js
path---packages-gatsby-plugin-offline-204bbe22742182397cfc.js.map
path---packages-gatsby-plugin-postcss-sass-7c6a188aeaf518b83d36.js
path---packages-gatsby-plugin-postcss-sass-7c6a188aeaf518b83d36.js.map
path---packages-gatsby-plugin-preact-a9a4262f36f22b861ddc.js
path---packages-gatsby-plugin-preact-a9a4262f36f22b861ddc.js.map
path---packages-gatsby-plugin-react-css-modules-b2773b1613c5b75f25e1.js
path---packages-gatsby-plugin-react-css-modules-b2773b1613c5b75f25e1.js.map
path---packages-gatsby-plugin-react-helmet-c116471c881f3e0b6b3c.js
path---packages-gatsby-plugin-react-helmet-c116471c881f3e0b6b3c.js.map
path---packages-gatsby-plugin-react-next-946971e06601426b957a.js
path---packages-gatsby-plugin-react-next-946971e06601426b957a.js.map
path---packages-gatsby-plugin-remove-trailing-slashes-44826c8bcdb166596ee0.js
path---packages-gatsby-plugin-remove-trailing-slashes-44826c8bcdb166596ee0.js.map
path---packages-gatsby-plugin-sass-46988f44ba778412fc7c.js
path---packages-gatsby-plugin-sass-46988f44ba778412fc7c.js.map
path---packages-gatsby-plugin-sharp-955e4eae8a391e4306d8.js
path---packages-gatsby-plugin-sharp-955e4eae8a391e4306d8.js.map
path---packages-gatsby-plugin-sitemap-639c0bfc3e2d37a7d378.js
path---packages-gatsby-plugin-sitemap-639c0bfc3e2d37a7d378.js.map
path---packages-gatsby-plugin-styled-components-75645e45dba86512f03a.js
path---packages-gatsby-plugin-styled-components-75645e45dba86512f03a.js.map
path---packages-gatsby-plugin-styled-jsx-87f38beca53ab97abfe8.js
path---packages-gatsby-plugin-styled-jsx-87f38beca53ab97abfe8.js.map
path---packages-gatsby-plugin-styletron-eae9fdbedab942744953.js
path---packages-gatsby-plugin-styletron-eae9fdbedab942744953.js.map
path---packages-gatsby-plugin-stylus-df777a043bd5790a5500.js
path---packages-gatsby-plugin-stylus-df777a043bd5790a5500.js.map
path---packages-gatsby-plugin-twitter-cb6351bd5821c1fb223b.js
path---packages-gatsby-plugin-twitter-cb6351bd5821c1fb223b.js.map
path---packages-gatsby-plugin-typescript-fdd47bd0a5159bd2b933.js
path---packages-gatsby-plugin-typescript-fdd47bd0a5159bd2b933.js.map
path---packages-gatsby-plugin-typography-fd4374848056b6e74297.js
path---packages-gatsby-plugin-typography-fd4374848056b6e74297.js.map
path---packages-gatsby-react-router-scroll-a13372cd27d5ac844fd6.js
path---packages-gatsby-react-router-scroll-a13372cd27d5ac844fd6.js.map
path---packages-gatsby-remark-autolink-headers-d8334cf6ec600add87d4.js
path---packages-gatsby-remark-autolink-headers-d8334cf6ec600add87d4.js.map
path---packages-gatsby-remark-code-repls-ffaed3c4a38bf6e44ade.js
path---packages-gatsby-remark-code-repls-ffaed3c4a38bf6e44ade.js.map
path---packages-gatsby-remark-copy-linked-files-e4ac1cb080a30161a8f3.js
path---packages-gatsby-remark-copy-linked-files-e4ac1cb080a30161a8f3.js.map
path---packages-gatsby-remark-custom-blocks-deafb74742f6ae572785.js
path---packages-gatsby-remark-custom-blocks-deafb74742f6ae572785.js.map
path---packages-gatsby-remark-embed-snippet-8765a21f03f655cae277.js
path---packages-gatsby-remark-embed-snippet-8765a21f03f655cae277.js.map
path---packages-gatsby-remark-images-23bde6d7015a9b310bca.js
path---packages-gatsby-remark-images-23bde6d7015a9b310bca.js.map
path---packages-gatsby-remark-katex-5de3bce0f22fcfa5ed29.js
path---packages-gatsby-remark-katex-5de3bce0f22fcfa5ed29.js.map
path---packages-gatsby-remark-prismjs-090b15e1ab88037006f1.js
path---packages-gatsby-remark-prismjs-090b15e1ab88037006f1.js.map
path---packages-gatsby-remark-responsive-iframe-907ed3d084c13120e7c3.js
path---packages-gatsby-remark-responsive-iframe-907ed3d084c13120e7c3.js.map
path---packages-gatsby-remark-smartypants-7b01084064d22f73c573.js
path---packages-gatsby-remark-smartypants-7b01084064d22f73c573.js.map
path---packages-gatsby-source-contentful-77904e8ec437f59f19aa.js
path---packages-gatsby-source-contentful-77904e8ec437f59f19aa.js.map
path---packages-gatsby-source-drupal-b98d34f0586813a8d72b.js
path---packages-gatsby-source-drupal-b98d34f0586813a8d72b.js.map
path---packages-gatsby-source-faker-532db8207c972a08f8f8.js
path---packages-gatsby-source-faker-532db8207c972a08f8f8.js.map
path---packages-gatsby-source-filesystem-545f5b2ddf4283ffd7aa.js
path---packages-gatsby-source-filesystem-545f5b2ddf4283ffd7aa.js.map
path---packages-gatsby-source-hacker-news-bbff45ecaba143ed7a31.js
path---packages-gatsby-source-hacker-news-bbff45ecaba143ed7a31.js.map
path---packages-gatsby-source-lever-316a9dc5e46c94e98a0d.js
path---packages-gatsby-source-lever-316a9dc5e46c94e98a0d.js.map
path---packages-gatsby-source-medium-5422477a7fc1bd363c27.js
path---packages-gatsby-source-medium-5422477a7fc1bd363c27.js.map
path---packages-gatsby-source-mongodb-fc6881ae65860f34f606.js
path---packages-gatsby-source-mongodb-fc6881ae65860f34f606.js.map
path---packages-gatsby-source-wordpress-68b4bb227853ef91d7b1.js
path---packages-gatsby-source-wordpress-68b4bb227853ef91d7b1.js.map
path---packages-gatsby-source-wordpress-com-977619ac5e6be6c6ab45.js
path---packages-gatsby-source-wordpress-com-977619ac5e6be6c6ab45.js.map
path---packages-gatsby-transformer-csv-f9d04ebda4cea89eadc9.js
path---packages-gatsby-transformer-csv-f9d04ebda4cea89eadc9.js.map
path---packages-gatsby-transformer-documentationjs-ba54db80a53a376ef044.js
path---packages-gatsby-transformer-documentationjs-ba54db80a53a376ef044.js.map
path---packages-gatsby-transformer-docx-e0800eb3628ec527ef90.js
path---packages-gatsby-transformer-docx-e0800eb3628ec527ef90.js.map
path---packages-gatsby-transformer-excel-aeb56786276a63a868cf.js
path---packages-gatsby-transformer-excel-aeb56786276a63a868cf.js.map
path---packages-gatsby-transformer-hjson-6eb6eeccc33b3b08ba0a.js
path---packages-gatsby-transformer-hjson-6eb6eeccc33b3b08ba0a.js.map
path---packages-gatsby-transformer-javascript-static-exports-592b7493c604edd00942.js
path---packages-gatsby-transformer-javascript-static-exports-592b7493c604edd00942.js.map
path---packages-gatsby-transformer-json-6a39049a655d468bee98.js
path---packages-gatsby-transformer-json-6a39049a655d468bee98.js.map
path---packages-gatsby-transformer-pdf-869135f7b6e8709b36e0.js
path---packages-gatsby-transformer-pdf-869135f7b6e8709b36e0.js.map
path---packages-gatsby-transformer-react-docgen-e826a5e1aa6bc873022f.js
path---packages-gatsby-transformer-react-docgen-e826a5e1aa6bc873022f.js.map
path---packages-gatsby-transformer-remark-3dfbc546f6eef37ae1f6.js
path---packages-gatsby-transformer-remark-3dfbc546f6eef37ae1f6.js.map
path---packages-gatsby-transformer-sharp-3bb2a80b064d16a90c14.js
path---packages-gatsby-transformer-sharp-3bb2a80b064d16a90c14.js.map
path---packages-gatsby-transformer-toml-a832aa55138caf9b292c.js
path---packages-gatsby-transformer-toml-a832aa55138caf9b292c.js.map
path---packages-gatsby-transformer-xml-b4faf19f0da7b7f712ce.js
path---packages-gatsby-transformer-xml-b4faf19f0da7b7f712ce.js.map
path---packages-gatsby-transformer-yaml-018ca2b1cb14d6e45866.js
path---packages-gatsby-transformer-yaml-018ca2b1cb14d6e45866.js.map
path---packages-graphql-skip-limit-b4497b66177a91b1747f.js
path---packages-graphql-skip-limit-b4497b66177a91b1747f.js.map
path---readme-fdfb4969ba3d62118f5e.js
path---readme-fdfb4969ba3d62118f5e.js.map
path---tutorial-a0e39f21c11f6a62c5ab.js
path---tutorial-a0e39f21c11f6a62c5ab.js.map
path---tutorial-part-four-c3fd53c3a8d59e3542a6.js
path---tutorial-part-four-c3fd53c3a8d59e3542a6.js.map
path---tutorial-part-one-120b6a42cfad06315b3b.js
path---tutorial-part-one-120b6a42cfad06315b3b.js.map
path---tutorial-part-three-6324bdd2626b06c47f49.js
path---tutorial-part-three-6324bdd2626b06c47f49.js.map
path---tutorial-part-two-a2011c0c2c79a4c24b54.js
path---tutorial-part-two-a2011c0c2c79a4c24b54.js.map
safari-pinned-tab.svg
sitemap.xml
static/
stats.json
styles.css
sw.js
tutorial/
Proposed `public/` directory for gatsbyjs.org
___gatsby/  <----------------- This directory is new
404/
404.html
README/
_headers
android-chrome-192x192.png
android-chrome-512x512.png
apple-touch-icon.png
blog/
browserconfig.xml
code-of-conduct/
colors/
community/
contributors/
docs/
favicon-16x16.png
favicon-32x32.png
favicon.ico
features/
images/
index.html
mstile-150x150.png
offline-plugin-app-shell-fallback/
packages/
safari-pinned-tab.svg
sitemap.xml
static/
tutorial/

The top-level directory listing has gone from 451 items down to 28 items. Maybe it's just a small thing but I think this is a good win for Gatsby's usability without any major downsides.

The trade-off is that the user can no longer create any routes named ___gatsby, but I think that's ok? It could be configurable if necessary, but maybe better just to use an unusual name.

@monsieurnebo
Copy link
Contributor Author

@calcsam @m-allanson is totally right. The output directory name customization would be useful for uniformity purpose (e.g. our CircleCI scripts are using a /dist/ for all our projects, except... Gatsby where we have to do an ugly mv public dist).

But no matter what this name is, the output files will be located at the hosting root, where we have the problem described in the current issue (and well summed up by m-allanson).

@KyleAMathews KyleAMathews reopened this Feb 8, 2018
@KyleAMathews
Copy link
Contributor

@m-allanson 👍

I think _gatsby is rather... ugly.

How about just /js/ as the subdirectory? That's quite common. If there's worries about conflicting with a path someday somewhere, we could also do /_js/.

@monsieurnebo
Copy link
Contributor Author

@KyleAMathews I think /js/ is not explicit, it's hard to spot what this directory contains without be gatsby-friendly.

/gatsby/ (or /_gatsby/) is simple, intelligible and shouldn't cause conflicts.

@KyleAMathews
Copy link
Contributor

/gatsby/ doesn't make sense because Gatsby can and does put files elsewhere e.g. /static/. I'd rather the folder name be based on functionality than imply that every file Gatsby will ever create will be in one folder which won't happen.

@ptb
Copy link
Contributor

ptb commented Feb 26, 2018

As a means of documenting one possible solution for this issue, I created an example repository to test. I'm not suggesting this is the best solution, but it might help to identify where paths may need to be changed.

@m-allanson
Copy link
Contributor

m-allanson commented Feb 27, 2018

@ptb nice! I'm loving the postinstall patch. For the curious, the public folder of @ptb's repo looks like this:

./
./chunk-manifest.json
./css/
./css/styles.css
./index.html
./js/
./js/a-appmain-21129a0ac3fa2757df65.js
./js/a-appmain-21129a0ac3fa2757df65.js.map
./js/b-commons-f7a0a7a05adacd8bdb22.js
./js/b-commons-f7a0a7a05adacd8bdb22.js.map
./js/c/
./js/c/c-93f95c4c-862182fbdb19e9f8504a.js
./js/c/c-93f95c4c-862182fbdb19e9f8504a.js.map
./js/p/
./js/p/p-e19cef0f-a0e39f21c11f6a62c5ab.js
./js/p/p-e19cef0f-a0e39f21c11f6a62c5ab.js.map
./static/
./stats.json

It's likely people will have their own opinions on how best to organise and name the files. We may need to pick something reasonably uncontroversial and stick with it.

I also think we should label this up as a v2 feature?

@m-allanson m-allanson added the help wanted Issue with a clear description that the community can help with. label May 31, 2018
@brotzky
Copy link
Contributor

brotzky commented Jul 2, 2018

@m-allanson or @ptb. Was this added to v2 or are you still looking for help on it? We'd love this feature for v2 if it's not implemented yet. I can investigate if it still needs help!

@m-allanson
Copy link
Contributor

@brotzky help on this is still welcome!

@brotzky
Copy link
Contributor

brotzky commented Jul 3, 2018

@m-allanson I'll take a look today!
It's a hard requirement from one of our partners for them to accept our proposal to use Gatsby for the project.

@KyleAMathews
Copy link
Contributor

@brotzky copying the files on build completion isn't an option?

@brotzky
Copy link
Contributor

brotzky commented Jul 3, 2018

@KyleAMathews

I think I'll attempt using the postinstall script that was linked before and see how far I get. I am leaning towards not having this as part of Gatsby core.

Actually, this postinstall script is okay but depends on the internals of Gatsby so it's always a moving target. Maybe this is a worthwhile feature in core?

@brotzky
Copy link
Contributor

brotzky commented Jul 4, 2018

I've opened a WIP PR that groups non-static files
#6285

@m-allanson
Copy link
Contributor

m-allanson commented Jul 17, 2018

Done in #6346. 👏 Many thanks to @brotzky for doing all the hard work on this one 💯

Published as gatsby@2.0.0-beta.41

@monsieurnebo
Copy link
Contributor Author

Great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with.
Projects
None yet
Development

No branches or pull requests

7 participants