jspm / github

Github Location Service
16 stars 43 forks source link

Got a npm package working did I do it the right way? #87

Closed babakness closed 8 years ago

babakness commented 8 years ago

I install a jquery plugin, it didn't work at first with an error saying the package wasn't found. I made some change and it worked. This is what I did.

To install:

jspm install npm:unveil2
vi config.js

changed config.js

"unveil2": "npm:unveil2@2.0.5"

to

"unveil2": "npm:unveil2@2.0.5/dist/jquery.unveil2.min.js ",

Is there a better way to do this? Any recommendations if I should share this and how? Many thanks.

guybedford commented 8 years ago

This isn't recommended as having changed the package name format, it will no longer be version controlled properly and will miss out on upgrades etc.

The idea here is that dist/jquery.unveil2.min.js is the main entry point of the package, so this can be done via jspm install npm:unveil2 -o "{main:'dist/jquery.unveil2.min.js'}" effectively providing the missing info from the package.json. In jspm 0.17 this can be done with the slightly nicer syntax jspm install npm:unveil2 -o main=dist/jquery.unveil2.min.js.