0

Before start using node package manager, i was just downloading packages into one folder and giving references from html files. Now i have started to use node package manager and i want to done thing right.

I have downloaded jquery via npm install jquery --save command. Jquery is downloaded with minified, unminified, source, readme etc files, so i got more than 30 files downloaded.

How should i use those files in production? I mean all i need is one minified jquery file in production. Should i delete rest before deploying? I feel like npm can make my life easier but i am missing the point.

How should i approach to this?

Sefa
  • 8,865
  • 10
  • 51
  • 82

2 Answers2

1

When you use npm, the dependency is gonna be used only on server-side. I recommend you search for bower, it has the same purpose npm has, but for the client-side.

And about minified and full versions it's ok do maintain both versions, as long as you configure that, on production, to load the minified versions of your libraries.

Sergio Marcelino
  • 1,142
  • 8
  • 17
  • unless the package is unavailable on bower, which is my case. Any other idea's? I need to use lodash, there isint a bower package. – alphapilgrim Mar 29 '16 at 20:43
0

I would recommend against deleting the entire package even if you need 1 file as there probably won't be any harm having a couple extra files. npm will allow you automatically update packages in the future... something you may not be able to do if you manually include a single file.

Szpok
  • 53
  • 1
  • 1
  • 7