How to debug a Gulp task?

后端 未结 7 1759
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-30 01:12

How do I debug a gulp task defined in my gulpfile.js with a debugger such as the Google Chrome debugger, stepping through the task\'s code line by line?

相关标签:
7条回答
  • 2021-01-30 01:46

    If you are using gulp-nodemon you can do this in your gulpfile. Just pass it the execMap option:

    gulp.task('default', function() {
        nodemon({
            script: 'server.js',
            ext: 'js',
            execMap: {
                js: "node --inspect"
            }
        })
    }
    

    Hope this helps.

    0 讨论(0)
提交回复
热议问题