Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Vaadin: Do I need to persist package.json and package-lock.json?

When you build Vaadin it generates two files: package.json and package-lock.json.

Do I need to persist them in my VCS (Git in my case)?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

package.json contains the frontend / npm / JavaScript dependencies for your project. If you do not add any custom dependencies to it, it can (and will) be re-generated automatically based on @NpmPackage annotations in Java sources.

package-lock.json is the means to provide a reproducible build. If you remove that, then the next build of the project might use different versions of some dependencies. In the worst case, the new versions have some bugs or compatibility problems and your project will no longer work.

It is therefore recommended to keep at least package-lock.json in the repository. If you are doing that, then keeping package.json also makes sense, as they kind of go hand in hand.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading