Don't commit built files in the repo
See original GitHub issueFiles like assets/scripts/dist/choices.js
(and company) are needed to be rebuilt every time. This should not be the case.
Fix
-
Add
files
in package.json to whitelist all the files needed, but do NOT includeassets/scripts/dist/
in it. -
Add a
scripts.prepublish
in package.json to runnpm run js:build
(and whatever else is needed) -
Add
assets/scripts/dist/
to.gitignore
-
Remove the files using
git rm -rf --cached assets/scripts/dist
What it does
The files will not be in the Git repository anymore.
They are, however, uploaded to npm. Just run npm publish
and it will build the files and upload them to the npmjs.com registry.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
What not to commit - Dart programming language
The rules. Don't commit the following files and directories created by pub: .dart_tool/ build/ pubspec.lock # Except for application packages.
Read more >Ignoring files - GitHub Docs
You can create a .gitignore file in your repository's root directory to tell Git which files and directories to ignore when you make...
Read more >Ignore files in your Git repo - Azure - Microsoft Learn
Learn how to exclude files from Git version control by using gitignore and exclude files, the git update-index command, and repo management.
Read more >How can I ignore a file that has already been committed to a ...
Git can only ignore files that are untracked - files that haven't been committed to the repository, yet. That's why, when you create...
Read more >.gitignore file - ignoring files in Git | Atlassian Git Tutorial
Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If the dist files are removed from the repo, what would be the best way for those who aren’t using node to get the built files?
…by the way, I’m asking this because it’d be much easier for us who would occasionally maintain forks of Choices. We can’t always easily contribute our fixes back, because PR’s here should not have the dist files rebuilt.