{"action":"created","issue":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/3760","repository_url":"https://api.github.com/repos/gatsbyjs/gatsby","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/3760/labels{/name}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/3760/comments","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/3760/events","html_url":"https://github.com/gatsbyjs/gatsby/issues/3760","id":292350191,"number":3760,"title":"Regroup non-static files into a public's subdirectory","user":{"login":"monsieurnebo","id":2378274,"avatar_url":"https://avatars0.githubusercontent.com/u/2378274?v=4","gravatar_id":"","url":"https://api.github.com/users/monsieurnebo","html_url":"https://github.com/monsieurnebo","followers_url":"https://api.github.com/users/monsieurnebo/followers","following_url":"https://api.github.com/users/monsieurnebo/following{/other_user}","gists_url":"https://api.github.com/users/monsieurnebo/gists{/gist_id}","starred_url":"https://api.github.com/users/monsieurnebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monsieurnebo/subscriptions","organizations_url":"https://api.github.com/users/monsieurnebo/orgs","repos_url":"https://api.github.com/users/monsieurnebo/repos","events_url":"https://api.github.com/users/monsieurnebo/events{/privacy}","received_events_url":"https://api.github.com/users/monsieurnebo/received_events","type":"User","site_admin":false},"labels":[{"id":779050110,"url":"https://api.github.com/repos/gatsbyjs/gatsby/labels/Feature%20Request","name":"Feature Request","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-01-29T10:13:31Z","updated_at":"2018-02-06T09:02:18Z","closed_at":"2018-02-04T17:02:21Z","author_association":"NONE","body":"# The idea\r\nIt would be useful to regroup all the non-static files of the build into a subdirectory of `/public/`.  \r\n\r\nSomething like:\r\n\r\n```\r\n|-public/\r\n  |- static/\r\n    |- header.jpg\r\n    |- comicSansMs.ttf\r\n    |- ...\r\n  |- res/\r\n    |- about/\r\n    |- contact/\r\n    |- component---src-pages-about-....\r\n    |- component---src-pages-contact-....\r\n    |- path---about-...\r\n    |- path---contact...\r\n    |- styles.css\r\n    |- ...\r\n```\r\n\r\nWhere `/res/` would be the directory, that's a placeholder name.\r\n\r\n# Why ? \r\n\r\nYou 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:\r\n- All the page folders\r\n-  `app-...` files\r\n- `commons-...` files\r\n- `component--- ...` files\r\n- `path---...` files\r\n- `styles.css` file\r\n- And more... \r\n\r\nWe quickly can have something like 40 files to manage.\r\n\r\nIn 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...\r\n\r\nIt could be an interesting feature for v2 (along the ability of choosing the `public` directory name) :)\r\n"},"comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments/363355464","html_url":"https://github.com/gatsbyjs/gatsby/issues/3760#issuecomment-363355464","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/3760","id":363355464,"user":{"login":"monsieurnebo","id":2378274,"avatar_url":"https://avatars0.githubusercontent.com/u/2378274?v=4","gravatar_id":"","url":"https://api.github.com/users/monsieurnebo","html_url":"https://github.com/monsieurnebo","followers_url":"https://api.github.com/users/monsieurnebo/followers","following_url":"https://api.github.com/users/monsieurnebo/following{/other_user}","gists_url":"https://api.github.com/users/monsieurnebo/gists{/gist_id}","starred_url":"https://api.github.com/users/monsieurnebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monsieurnebo/subscriptions","organizations_url":"https://api.github.com/users/monsieurnebo/orgs","repos_url":"https://api.github.com/users/monsieurnebo/repos","events_url":"https://api.github.com/users/monsieurnebo/events{/privacy}","received_events_url":"https://api.github.com/users/monsieurnebo/received_events","type":"User","site_admin":false},"created_at":"2018-02-06T09:02:18Z","updated_at":"2018-02-06T09:02:18Z","author_association":"NONE","body":"@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`). \r\n\r\nBut 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)."}}
{"actor":{"display_login":"monsieurnebo"}}