Fixes duplicate comments in minified JS build

Prior to this fix we saw repeated comments in the build for minified
JS. Whilst this is otherwise fine for the unminified build (at this
time) we shouldn’t be including dupes for license headers.
master
Addy Osmani 2015-06-30 17:44:52 +01:00
parent 338431d6d9
commit b887c1a7d1
1 changed files with 5 additions and 3 deletions

View File

@ -217,11 +217,13 @@ gulp.task('scripts', function () {
.pipe($.sourcemaps.init())
// Concatenate Scripts
.pipe($.concat('material.js'))
.pipe($.header(banner, {pkg: pkg}))
.pipe(gulp.dest('./dist'))
// Minify Scripts
.pipe($.uglify({preserveComments: 'some', sourceRoot: '.',
sourceMapIncludeSources: true}))
.pipe($.uglify({
sourceRoot: '.',
sourceMapIncludeSources: true
}))
.pipe($.header(banner, {pkg: pkg}))
.pipe($.concat('material.min.js'))
// Write Source Maps
.pipe($.sourcemaps.write('./'))