Get the current file name in gulp.src()

后端 未结 6 758
温柔的废话
温柔的废话 2020-11-28 21:57

In my gulp.js file I\'m streaming all HTML files from the examples folder into the build folder.

To create the gulp task is not difficult:

6条回答
  •  伪装坚强ぢ
    2020-11-28 22:28

    If you want to use @OverZealous' answer (https://stackoverflow.com/a/21806974/1019307) in Typescript, you need to import instead of require:

    import * as debug from 'gulp-debug';
    
    ...
    
        return gulp.src('./examples/*.html')
            .pipe(debug({title: 'example src:'}))
            .pipe(gulp.dest('./build'));
    

    (I also added a title).

提交回复
热议问题