#19: devDependencies in package.json - Mastering NPM

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 12

  • @Sharma.Saurabh
    @Sharma.Saurabh 3 года назад

    Lets say I have an angular app and all angular dependencies are in devDependecies... And my Node_Env =production so when I will run npm install it will not install my devDependecies on my server then how ng commands like ng build or ng serve will work?

  • @davidsalvador3855
    @davidsalvador3855 3 года назад

    thank u for your time, good man

  • @RajeshKumar-uu8by
    @RajeshKumar-uu8by 2 года назад

    if we add library as dev dependency then how it will run in prod because we added only for development

  • @CodezTech
    @CodezTech 3 года назад +2

    Wow, Nice, exactly what I am looking for.

  • @hashcodehub6717
    @hashcodehub6717 Год назад

    great explaination love all of your videos man

  • @gracewood6768
    @gracewood6768 3 года назад

    sorry but i can't still understand
    i understand that dev dependencies are for testing, or webpack or lints like that, but how about installing less, craco, material ui, font awesome aka the designing libraries? Where should I put it?

    • @calvinwilson3617
      @calvinwilson3617 3 года назад

      When in doubt just put all dependencies in normal dependencies, as it just results in a slightly slower build and disk size on the deployed server, but you will spend a while troubleshooting if you put something in dev dependencies and then try to automate the build on an external client. As to your question, any logging or anything you want to still function for your users must be included. But any linting, formatting, and unit tests do not need deployed because they are design time or self analysis so can be in the dev deps. Images or resources (fomtawesome) that are required to be pulled by webpack must still be in normal deps, as webpack itself pulls the resources from the npm folders if you have it set up that way (use the file copy plugin for webpack to copy the resources out and into the www resource folder). Otherwise you have to manually copy the files from node_modules to where webpack points.

  • @harshilparmar9076
    @harshilparmar9076 4 года назад

    Bro is that NODE_ENV sets property to global env ? Is there any global env or it just like setting environment variable for windows.??Thanks

    • @codedamn
      @codedamn  4 года назад +1

      NODE_ENV should be a global variable set to the environment you're working in.

  • @orincywhytedesigns
    @orincywhytedesigns 2 года назад

    Whoa I’m gonna check if this fixes my issue! Even if it doesn’t, this was quite informative!

  • @przemysawniemiec2635
    @przemysawniemiec2635 Год назад

    Great explained, thanks

  • @aminsoraya
    @aminsoraya 3 года назад

    good described