gulp-useref icon indicating copy to clipboard operation
gulp-useref copied to clipboard

Question: No Concat and re-concat

Open jstoneky opened this issue 10 years ago • 4 comments

Has anyone used the noconcat option to modify the stream contents, and then successfully concatenated back into the correctly named files (for multiple blocks) ?

I want to modify a file in the stream before it gets concatenated -- and i don't quite see a way to do this yet.

jstoneky avatar Jan 12 '15 22:01 jstoneky

I would also like to know this

JetFault avatar Jan 29 '15 17:01 JetFault

Post your code.

joshunger avatar Mar 18 '15 23:03 joshunger

Hi, also interesting in solution, here is code example

    gulp.task('index', function () {
        var assets = $.useref.assets({
            noconcat: true
        });

        return gulp.src('./*.html')
            .pipe(assets)
            .pipe($.if('*.js', $.ngAnnotate()))
            .pipe($.if(/.*[^\.min].js/, $.uglify()))
            .pipe($.if('*.css', $.minifyCss({keepSpecialComments: 0})))
            .pipe(assets.restore())
            .pipe($.useref())
            // Output files
            .pipe(gulp.dest(buildDir))
            .pipe($.size({title: 'index'}));
    });

I want to concat files after minimize some of them. Can I do this without additional tasks?

jeneg avatar Aug 28 '15 08:08 jeneg

This might help https://github.com/jonkemp/gulp-useref/issues/136

Tiagoperes avatar Dec 21 '15 16:12 Tiagoperes