DEV Community

Jordan
Jordan

Posted on

JS Delivery Best Practices?

At my current company we build our js with rollup, package it, and then publish it as a versioned package to a self-hosted repo. No built files are committed to git. We use lerna to publish canary builds during dev. For prod we manually run a build process to publish the full prod version.

Recently some coworkers at my company have suggested this process is too complicated. One in particular is pushing for us to commit built/generated files straight to git. Now I know this is bad practice, and I've simply accepted this without really thinking about why. Looking around for info hasn't turned up much. One solid point is that you're setting yourself up for consistent merge conflicts since every merge should contain a newly built version of the project. If the project has been touched since you branches then your built files will conflict with the newly built files in the original branch.

What do you guys think? How do you deliver your js? Why is it bad practice to commit js files to git?

Top comments (0)