Should you run npm run build on your development machine and commit everything to Git or should you commit your app without those files and run npm ru

Should I run npm run build/prod on dev or prod?

submited by
Style Pass
2024-05-07 10:00:07

Should you run npm run build on your development machine and commit everything to Git or should you commit your app without those files and run npm run build on your production server? Here are the pros and cons of those two approaches:

Automate the build process using a CI/CD pipeline. This way, you can run tests and build in a controlled environment, and then deploy the artifacts to production. This combines the benefits of both approaches.

Vincent Schmalbach is an entrepreneur, software developer and SEO expert. He works as a freelance software developer and specializes in modern SaaS and business app development, leveraging well over 10 years of experience in the field.

Leave a Comment