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?

  • FooBarrington@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    9 months ago

    I don’t think it’s accurate to say that for frontend, everything should be a devDependency. It’s more a matter of personal taste what goes where. I’ve had good experiences with using devDependencies for anything that doesn’t end up in the bundle, and everything else as a normal dependency. That seems more useful than having everything in one category.

    • dan@upvote.au
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      9 months ago

      Sure, that’s fine. I think I didn’t word my comment well. What I meant to say was that you only ever do dev installs for frontend apps, so there’s no difference between dev dependencies and regular dependencies. You can split things however you want.