问题
I would like to use this node library: https://github.com/sudhirj/simply-deferred
I ran:
npm install simply-deferred
And added it to package.json under dependencies.
"simply-deferred": "*"
It installed successfully:
> require ("simply-deferred")
{ Deferred: [Function],
when: [Function],
installInto: [Function] }
But it is not added to vendor.js, and when I run require("simply-defered"), it says module not found (even when i manually added the js file to /vendors.
I am quite sure I am missing something obvious here, I am a npm/node n00b, so any help would be much appreciated!
回答1:
You cannot require NPM modules in brunch app. From the site:
Brunch is a HTML5 application assembler
npm is node.js package manager. Brunch is HTML5 app builder. Different stuff.
来源:https://stackoverflow.com/questions/17418027/using-a-npm-module-in-a-brunch-app