Using gulp without global gulp //edit: and without linking to the bin js file

前端 未结 6 1141
野趣味
野趣味 2021-02-12 18:16

I have a gulpfile.js that runs through perfectly when typing gulp into the commandline.

All the gulp bash command really does is calling the sp

6条回答
  •  梦谈多话
    2021-02-12 18:33

    I think the most direct answer is the following:

    node ./node_modules/gulp/bin/gulp.js
    

    Yes, adding to your npm scripts works, but this doesn't help in situations like automated builds where you are trying to run a gulp task for existing code from a repo and you can't easily change package.json.

    Generally speaking Sander Visser's answer is probably the "best", but this is the lowest level call that can be implemented anywhere.

提交回复
热议问题