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?

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay