-
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
chore(docs): Add --prefix-paths option to gatsby develop docs #14319
Conversation
## Description The gatsby-cli `gatsby develop` command currently supports the `--prefix-paths` option that `gatsby build` and `gatsby serve` supports but the option is not documented anywhere. This change adds that documentation.
Thanks for your PR! I found a issue with Description of the bug: the files under the example: PS: I'm not part of Gatsby Core, so I'm not sure the bug described is the intended behavior. |
linting is failing, please run one of:
and push the changes 🙂 |
Hey! Thanks so much for opening a pull request! The change you’ve proposed is not going to be accepted because the CLI doesn't support this flag on We absolutely want to have you as a contributor, so please take a look at our open issues for ideas, and please reach out to us on Twitter at We offer pair programming sessions if you’d like to work with one of our maintainers to make your first contribution. Thanks again, and we look forward to seeing more PRs from you in the future! 💪💜 |
Hey @LekoArts thanks again for reviewing! 😄 It's a bit unfortunate that I was researching a bit, using it to simplify the front-end architecture here, and having it officially supported would be awesome! I was coupling it with |
@LekoArts thanks for the feedback! Although the develop cli command does not document the It works because the I don't see any logic in |
Ah sorry I misunderstood @leonardodino I see that static assets are not being served under the |
Thank you very much that you want to take this on but I'd kindly ask you to not to. The current implementation is working as intended, the |
@LekoArts can I open an RFC to support
I believe that the build output ( meant for production ) and the develop output should match. If not you can run into inconsistencies with path dependent data like slugs etc. which would lead to bugs that don't happen locally when developing but then do happen in production. |
@jsanchez034 let me address a few of your questions!
This doesn't need an RFC, but we appreciate the offer! The potential for breakage coupled with how substantial/impactful the feature will be is what constitutes the need for an RFC--and I don't think we need that here!
Fair enough, and we generally agree. It's weird to have little idiosyncrasies between development and build, but the approach is that some trade-offs are OK if they lead to e.g. a faster development experience. It would not be an ideal development experience if dev/build were exactly the same as far as speed of changes and instant feedback are concerned.
The potential for breakage here is fairly low because the general approach is don't prefix your links and use the In a roundabout way--we wouldn't necessarily mind enabling this functionality, especially because it seems to already kind of work. We'd want to ensure the following:
If you'd be willing to tackle this, and we can meet all the above--we'd definitely consider a PR like you're proposing. |
Hi @DSchau, thank you for the detailed reply! I will look into creating a PR sometime this week with all the details you mentioned above. |
related: this is coming to Maybe we can leave this issue open, and rename it to properly implement/test the feature. |
For anyone still curious about this issue, You can add asset prefixing to gatsby develop mode by using the onPreRenderHtml function to inject a base tag into your html. This will prefix all relative links with the href attribute so long as the attribute is a fully qualified domain name Thank you @wardpeet edit: this wont prefix /common.js or /socket.io/socket.io.js |
Description
The gatsby-cli
gatsby develop
command currently supports the--prefix-paths
option thatgatsby build
andgatsby serve
supports but the option is not documented anywhere. This change adds that documentation.