question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Built files ("./dist") in version-control

See original GitHub issue

Built files are useless redundant noise in the git diff (a lot of it if you can never commit them), and generally make using Git more difficult for everyone

Listing them in the .gitignore does not have any effect because it does not make any sense; garbage in, garbage out.

Built files have no place in version-control (aka source-control, as in source, not build-control).

Package managers are our build-control; they are what we use to distribute/share build-code.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:20 (18 by maintainers)

github_iconTop GitHub Comments

4reactions
zenflowcommented, Jan 14, 2018

t4t5/sweetalert#748 does not apply to this repo, since our unobfuscated dist files are freely accessible on the npm package distribution registry (that is where unpkg.com gets packages from), unlike @t4t5’s sweetalert which only publishes the minfied/obfuscated dist files. Removing files from source-control does not mean they are removed from the package distribution.

I prefer to be less strict about VCS definition and be more accessible for all users and workflows.

Our distribution files are already perfectly accessible for all users and their workflows, minified or unminified, on the condition that the correct dist files are always present when you npm publish or yarn publish. (You should guard against human error regarding that condition, by running the build automatically before publishing, via scripts.prepublish in package.json)

(edit: Correction: If we removed the dist from Git, the Bower workflow would not supported anymore. Thanks for making this point @toverux)

I think/hope I made it clear that something that could use improvement is this package’s internal workflow. I would not complain, but like I said on t4t5/sweetalert#748…

Keeping build/dist files in source-control is really going against widespread convention and causes pain with Git tooling. Check out the setup of the React project for instance. It is extremely standard, in that dist files are included in the package distribution on npm (check the umd folder) and not included in the source-code repository on Github.

We can easily match that exactly.

3reactions
toveruxcommented, Jan 13, 2018

Isn’t bower downloading directly from GitHub? In this case, the users wouldn’t have the minified versions. What about the CDNs?

Publishing build artifacts on Git was common before npm. It is also seeked by users who don’t use a package manager and just click on “Download ZIP” (been there). I hate dist/ files too and you can see that all my JS repos are exempt from that, but they are targeting Angular or Node, where people always use npm. Dist files regularly cause pain here and require more work. But that’s still a common distribution system for this type of frontend libraries.

I’m not against removing them from Git because it’s just better for us and our users, but I’m worried this will impact some of them, as well as (if I’m right) the Bower/CDN distributions. It’s not just a “chore(package)” change in our package.json.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue: is it right to track dist files? - Stack Overflow
When I develop vue project, I keep track of files in dist folder. My laptop. I develop vue project -> npm(yarn) run build...
Read more >
dist folder not uploaded · Issue #43 · SamKirkland/FTP-Deploy ...
Bug Description I want to use this action for uploading the resulting folder of npm run build which is a dist folder in...
Read more >
Don't keep generated files in version control - Perl Maven
This generated file should not be kept in version control, nor should it be included in the distribution. .tidyall.d/ is a directory created ......
Read more >
Dist (automake) - GNU.org
For the most part, the files to distribute are automatically found by Automake: all source files are automatically included in a distribution, as...
Read more >
Do I include my dist folder when I upload to my github repo?
Binary files (e.g. executables) are not suited to version control. But Github has "releases" so you can tag a commit and upload the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found