Add custom new lines with Gulp uglify and Concat

Viewed 1979

I am using Gulp and gulp uglify and concat to create production JS. How can I add new lines before license comments?

Example output

/*! Version 1 */
function Test1(){}/*! Version 2 */
function Test(){}

Desired output

/*! Version 1 */
function Test1(){}
/*! Version 2 */
function Test(){}

My code that wraps the gulp sequence

function gulpDeploy(src, fileName, dest){
    gulp.src(src)
        .pipe(concat(fileName, {
            newLine:'\n;'
        }))
        .pipe(uglify({
            preserveComments : 'license'
        }))
        .pipe(gulp.dest(dest));
}

It looks like the newLine option should do it, but it doesn't do anything..

1 Answers
Related