this post was submitted on 01 Mar 2024
18 points (95.0% liked)

JavaScript

1700 readers
6 users here now

founded 2 years ago
MODERATORS
 

Official docs say it's for

Packages that are only needed for local development and testing.

Umm, okay. Not 100% clear there. Some articles mention things like ESLint or Jest (k, I'm onboard there) but others mention Babel or WebPack. I get that you don't need WebPack libraries to be loaded in the browser but how the hell do you bundle up your code without it? When you use npm ci or npm install you'll get all dependencies but isn't it good practice (in a CICD environment) to use --omit=dev or --only=prod?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] winky9827b 4 points 9 months ago (1 children)

Not always. If you're publishing your app as a docker image, you want the final image to exclude dev depending to be a small as possible.

[โ€“] BrianTheeBiscuiteer 1 points 9 months ago

This isn't exactly the case but yes, I would prefer to keep the dependency list as small as possible, mainly because I'm subject to security scans and I don't want things to get held up because there's a vulnerability in my linter.