DEV Community

Jordan
Jordan

Posted on

1

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay