-
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
absolute resolves for gatsby config files #1195
Conversation
Deploy preview ready! Built with commit 7f872f7 |
Deploy preview ready! Built with commit 7f872f7 |
Deploy preview ready! Built with commit 7f872f7 |
So... we've never supported running Gatsby from a different directory as it complicates a lot of code for what seems like a unnecessary reason. If you do want to run Gatsby from another directory, I'd suggest writing a script which just changes directory for you. Would that work? |
I'll explain my use-case to give some context. So I have a project that you can run on git repo and it generates a website, it's currently using gatsby as the engine to generate the site, but I have my own cli to mimic many of the gatsby functionalities and to implement some functionalities unique to what I need (like ejecting specific components/pages/layouts). This my source repo doesn't need to have any of the When I run So all sites are built from the landr package directory in It's working quite nicely, because the gatsby commands all seem to respect the This fixes that, but doesn't change standard gatsby behaviour because cwd is usually program.directory. Let me know if you need further explanation on any of the above :) |
Landr is so cool ❤️ This is an awesome use case for Gatsby. And really love that you implemented the eject functionality. Really keen to see how that goes. You were the one right I talked with on Discord a few weeks ago about Gatsby themes? Are you publishing your transformer plugins to NPM? Want to add a plugin search tool to gatsbyjs.org sooner than later for both official/community plugins. |
On the PR — I'm surprised things are just working for you as in the past, this use case proved tricky but perhaps things magically fixed themselves somewhere along the line :-) In any case, running gatsby commands from other directories is still not officially supported but no harm in merging PRs from you and others that want to make this use case work. |
Yea I saw one or two instances in the code that referenced process.cwd(), but everything is working so far 🙉. I haven't published the plugins yet, still figuring out exactly how they will work, but will let you know when I do publish em. Re: landr yea I think the idea has legs, will keep you updated. |
I'm running gatsby from another directory, so I need this to be an absolute path to properly cache bust.