javascript - Install all JSPM dependencies in gulp task -
i want have 1 command download dependencies project need. should gulp dependencies
. have jspm dependencies in fronted , can install them typing jspm install
in command line. want automate gulp (it take care other dependencies, too, pip, composer etc).
here have tried:
gulp.task('dependencies', ['deps-composer', 'deps-jspm', 'deps-pip']); // others gulp.task('deps-jspm', function (done) { require('jspm').install().then(done); });
however, creates empty jspm_packages
directory , not download anything.
i have succeeded following
gulp.task('deps-jspm', function (done) { require('child_process').execsync('jspm install'); });
but looks overkill , requires jspm installed globally.
the directory structure normal, i.e. there package.json
, config.js
, gulpfile.js
in root directory.
jspm.install()
expects package name first argument in order install specific package. if want install all packages have pass true
(see the docs):
gulp.task('deps-jspm', function (done) { require('jspm').install(true).then(done); });
Comments
Post a Comment