nk-o / gulp-change-file-content

Gulp plugin allow modify file in .pipe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gulp plugin allow modify file in .pipe

const gulp = require( 'gulp' );
const changeFileContent = require( 'gulp-change-file-content' );

gulp.task( 'js', () => (
    gulp.src( 'app/**/*.js' )
        .pipe( changeFileContent( ( content, path, file ) => {
            const start = '(function (){\n';
            const end = '\n})()';

            return `${ start }${ content }${ end }`;
        } ) )
        .pipe( gulp.dest( 'build' ) )
) );

About

Gulp plugin allow modify file in .pipe

License:MIT License


Languages

Language:JavaScript 100.0%