Comment out / add note about conflicting gitignore lines #3204
Conversation
Ref (introduction of a new "public" folder in Next.js): https://nextjs.org/blog/next-9-1#public-directory-support
|
Actually, the more I think about it, the more I like the simplicity of my other option - just to comment out I will change it to this now. |
|
Ok, I have changed it to the second version - a single Node.js The |
|
I am also fine with going back to my original solution, in case that is more desirable for the project team. |
|
@shiftkey Added an updated solution here, in case somehow this information got lost in the notifications. |
|
Thanks all! |
|
@nerdybeast if you'd like this reverted please open a PR so we can discuss it further |
|
@nerdybeast I would argue that in most cases you will want to ignore the build output in I think it's a reasonable default. You're going to need to go through this If this conflicts with some concrete, common use case that I haven't considered, then I would be all for making it optional! |
|
@karlhorky you bring up a fair point. I was thinking of few edge cases but I agree we should cater to the majority. Thank you for the kind response! |
* Remove conflicting gitignore lines, add reference Ref (introduction of a new "public" folder in Next.js): https://nextjs.org/blog/next-9-1#public-directory-support * Improve solution to conflicting files
* Remove conflicting gitignore lines, add reference Ref (introduction of a new "public" folder in Next.js): https://nextjs.org/blog/next-9-1#public-directory-support * Improve solution to conflicting files
* Remove conflicting gitignore lines, add reference Ref (introduction of a new "public" folder in Next.js): https://nextjs.org/blog/next-9-1#public-directory-support * Improve solution to conflicting files

Reasons for making this change:
Next.js recently introduced a feature to be able to use the
publicdirectory (should not be ignored), which conflicts with Gatsby's generate-onlypublicdirectory (which should be ignored).Since the Node.js gitignore file should be unopinionated when it comes to frameworks, I made the decision to move the files out to
community/JavaScript. I also did this for Nuxt.js, since this is a similar type of framework.Links to documentation supporting these rule changes:
Ref (introduction of a new "public" folder in Next.js):
https://nextjs.org/blog/next-9-1#public-directory-support
Ref: #2562 by @rgbkrk
Ref: #3180 by @ImedAdel
If this is a new template:
Alternatives considered:
An alternative would be to by default ignore all of the overlapping build directories (this would not ignore
public) and then add a note for Gatsby (potentially with a commented-out line withpublicon it).