Managing File Dependencies Using NPM

I am working on a large interface with a medium-sized team. So far, we have used requirejs and AMD modules to manage our ~ 500 file project. Recently, we decided to switch to commonjs and use NPM as our package manager for various reasons. Here is my question:

How to include in our package package.json a random single frame file (aka jquery plugin)?

For example, we use this random jquery color picker https://github.com/laktek/really-simple-color-picker/blob/master/jquery.colorPicker.min.js

However, the github repo does not have package.json, so using NPM built into git does not work. So what should I do instead? I'm trying to use its "file: ../../", but I think it wants me to point to the node module folder, and I'm not sure how best to install it.

Bonus Question

How do I handle โ€œshimsโ€, for example. I want my views to refer to the โ€œknockoutโ€, but actually refer to a file that includes the knockout itself, and add all our plugins and user kindness, and then re-export the knockout

Any help is appreciated!

+4
source share
1 answer

package.json (aka jquery plugin)?

. npm , . .

-, , npm bower / . , npm bower, .

, , git package.json :

"browser": {"colorPicker": "./thirdParty/jquery.colorpicker.js"}

"", . , "", , ,

, browserify-shim , .

/ , , , , jquery, jquery plugins, angularjs .

, , .

+2

All Articles