S
S
Sergey delphinpro2017-05-11 19:19:04
Node.js
Sergey delphinpro, 2017-05-11 19:19:04

How to filter files in galp stream?

There is a tax code

return gulp.src(paths.src)
    .pipe(webpackStream(wpConfig, webpack2))
    // .pipe(header(config.header.js, {updated: (new Date()).toUTCString()}))
    .pipe(gulp.dest(paths.dist))
    .pipe(browserSync.stream())

I would like to use gulp-header to insert headers into files. The problem is that webpackStream spits out both js files and .map.js sort maps. And gulp-header inserts a header into everything that is included in it, thereby spoiling the sourcemap.
How can I filter .map.js files so that they don't get processed by gulp-header but reach gulp.dest()?
Or maybe gulp-header pipe after writing to disk. Then you just need to filter .map files.
Damn, when js will be overwritten twice. In short, some kind of crap ... Xs what to do.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lekha Yarkov, 2017-05-11
@delphinpro

Obviously use gulp-filter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question