-
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
Change src directory to another directory name #2424
Comments
We don't support this atm. What's your use case for wanting to change the name? |
@KyleAMathews It's not a really strong one, it's fine. I just like using "app". Mostly because it appears at the top of my tree view. Kind of a petty use case... Thanks any way |
My use case I was after when I landed on this issue is around having a gatsby site inside another repo and the gatsby code would be the docs for that site. So something like this:
And then have the publishing setup to use that docs directory instead of src. |
REPOST of #2839 : I see that component-page-creator.js is the file I supposed is responsible for this default behavior but when I introduced my change, the app broke. Other files of interest are
The way I thought about introducing the custom path was through the gatsby-config.js because its loaded on bootstrap however it broke the query-watcher.js when I save the file with a change. What is the best way to introduce this custom path? |
If we want to make it possible to auto-create pages elsewhere, we should extract https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby/src/internal-plugins/component-page-creator to its own package then add a way to disable page creation. Then you could use the extracted package standalone to create pages from another directory. Want to take that on? |
@KyleAMathews I'm happy to give this a try although I will need a good bit of guidance. 😄 |
@nodox awesome! Want to create another issue and I'll add some suggestions there? |
I would also love this feature to change the directory name. I have the same use case as @arsdehnel, where I want it to be in like a |
@bluetidepro there's a nearly-complete PR for this over at #4490 |
I would love to be able to split my app into code used to build the site (page creation, node manipulation, configuration etc) and code related to rendering the site (components, styles, view helpers, queries etc). This would involve two subdirectories - |
@m-allanson Sweeeet. Can't wait for that to get merged! |
Work has been intense. Looking to get back on this sometime within the next 2 weekends. @m-allanson. |
No worries @nodox! Give yourself some downtime and come back to this whenever you're ready :) |
@m-allanson It looks like this issue was closed in #4490, but I'm having a ton of trouble tracking down how to use it. I didn't see anything in the Gatsby Config documentation, and the PR is a bit difficult to follow. Would it be possible to provide a simple example? Thanks! |
Hey @LandonSchropp it's not possible to rename the |
@m-allanson Thanks for the reply! |
In case of monorepo having configs to change source code folder would be great |
Hi, I love gatsby!
But I'd love to change the name of the src directory to another name.
I can't figure out exactly how to tell gatsby about this change.
Thanks
The text was updated successfully, but these errors were encountered: