Closed langpavel closed 6 years ago
I agree. I’d merge a PR to add it to .gitignore
.
What about distribution through bower or CDN?
I would have thought bowed effectively dead, since it’s been deprecated for around 7 months. And you can use unpkg for CDN functionality.
I disagree with this. I think a lot of users still uses libraries by simply downloading the zip file from Github. If you gitignore the dist folder, they won't be able to do this anymore. Also ignoring the dist file doesn't really add any value here (it's not like you want to save space in Github's HD or anything).
@Grsmto I cannot agree. Readable diffs are more important for code review workflow
I think a lot of users still uses libraries by simply downloading the zip file from Github.
For users who want to provide that, they can by all means do so. However, for the vast majority of users simply creating versions appropriate to the target and putting them in dist
and publishing that to npm will enable downloading files for use in a project as you say or referencing them directly by using unpkg. For example, http://unpkg.com/lgtm@latest/dist/lgtm.js.
Also ignoring the dist file doesn't really add any value here.
@langpavel is correct: readable diffs are more important than the marginal utility of having dist
checked into git. On top of that, you now have to make sure that the dist
build properly matches the source files. This is a tedious and error-prone process, which would be best automated away if it weren't better to simply omit dist
from git.
My own projects used to have the built version checked into dist
for exactly the reasons you gave, but years of experience of the pain it causes plus the fall of bower and the rise of tools like unpkg have made it clear that checking build files into git is not currently the best approach for npm packages, or likely any software system with build artifacts.
How i can create demo page for unpublished to NPM version of my lib? CDN works only with published versions.
Lots of ways:
gh-pages
branch as part of a demo websitebeta
tagThere’s no shortage of good options.
Nice, thanks!
Hi, thanks for great kick in! but..
I think that
dist
should be ignored from version control, likebuild
is excluded in many others projects.I expected that there will be more opinions, but I did't found it there, no much opened issues, no debates.. so I'm trying kick up this with this one :slightly_smiling_face: