How to delete comments without extinction in gulp?

I want to delete comments, but not guess the code. Is this possible with gulp? Or is it something that requires conversation or something else?

+5
source share
1 answer

Yes it is possible. For future reference, you should use the gulp registry of plugins . A quick search for "comments" found this:

var gulp = require('gulp'); var strip = require('gulp-strip-comments'); gulp.task('default', function () { return gulp.src('template.js') .pipe(strip()) .pipe(gulp.dest('dist')); }); 

https://github.com/RnbWd/gulp-strip-comments

+4
source

Source: https://habr.com/ru/post/1210582/


All Articles