evalify
browserify transform to eval modules before exporting.
npm i --save evalify
stolen from mmckegg/web-audio-school.
example
given a module:
// cats.jsvar catNames = var cats = for var i = 0; i < 10; i++ cats moduleexports = cats
compile using browserify
using -t [ evalify -f '**/cats.js' ]
browserify ./cats.js -t [ evalify -f '**/cats.js' ]
cats.js
file is transformed to
moduleexports = "Cali""Rascal""Jack""Jasmine""Kitty""Nala""Jack""Cookie""Jack""Buster"
usage
evalify
is a browserify transform with the following options:
files
(f
): a list ofminimatch
paths to determine whether to evaluate a given file.
using the browserify
cli:
browserify entry.js -t [ evalify -f '**/to-eval.js' ]
using your package.json
:
"browserify": {
"transform": [
["evalify", { files: [ "**/to-eval.js" ] } ]
]
}
license
ISC