gulp-mocha how to pass the compilers flag?

后端 未结 6 1767
隐瞒了意图╮
隐瞒了意图╮ 2021-02-14 10:01

I\'m trying to use the gulp-mocha module but can\'t figure out a good way to pass over the compilers flag. Is there a way to include this in my gulp task? Maybe in a separate

6条回答
  •  清歌不尽
    2021-02-14 10:13

    Justin Maat, you don't need to modify your gulpfile.js. You just need to use --require when using gulp from CLI:

    ### before
    gulp test
    
    ### after
    gulp --require babel/register test
    

    Do you notice the difference? And to save you a few keystrokes, add this to your .bashrc or .zshrc:

    alias gulp='gulp --require babel/register'
    

    and next time, you can use gulp as normal

    gulp test
    

提交回复
热议问题