1.安装npm包
npm install --save-dev gulp-strip-debug
2.使用
const gulp = require('gulp'); const stripDebug = require('gulp-strip-debug'); gulp.task('default', () => gulp.src('src/app.js') .pipe(stripDebug()) .pipe(gulp.dest('dist')) );
详情:https://www.npmjs.com/package/gulp-strip-debug