18

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
[-] Vincent@feddit.nl 1 points 8 months ago* (last edited 8 months ago)

Exactly. If nobody ever runs npm install <yourpackage>, don't worry about it. (Like, literally, you can put half your dependences in dependencies and half in devDependencies and it will be fine.)

If you do, then every dependency the person who runs that command doesn't necessarily need goes into your devDependencies.

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

JavaScript

1968 readers
1 users here now

founded 1 year ago
MODERATORS