javascript - Using plugins with browserify -



javascript - Using plugins with browserify -

i'm using ractive.js, events plugin it, ractive-events-keys, , browserify.

according usage ractive-events-keys, need require() it, , it'll install itself. isn't working however. upon closer inspection realised getting 2 versions of ractive in bundle (presumably because plugin required it's own version), added browser.ractive key package.json (kind of on whim, seemed work). have 1 ractive bundled, key event plugin still doesn't work (i.e., still warning telling me install plugin).

as far know, don't need browserify-shim, because modules designed work commonjs.

how work?

in project, have index.js (browserify entry point) , load plugins like:

var ractive = require('ractive'); // file reference: /*var keys = */ require('./js/ractive-transitions-fade'); // npm reference: /*var touch = */ require('ractive-touch'); var ractive = new ractive({...})

the plugin "registers" itself, still have "install" either file in assets or via npm

javascript browserify ractivejs

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -