Skip to content

Commit c0bd687

Browse files
committed
preserve important comments (often credits or configuration) in minified JavaScript
1 parent d3c2f53 commit c0bd687

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gulp.d/tasks/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = (src, dest, preview) => () => {
5555
return merge(
5656
vfs
5757
.src('js/+([0-9])-*.js', { ...opts, sourcemaps })
58-
.pipe(uglify())
58+
.pipe(uglify({ output: { comments: /^!/ } }))
5959
// NOTE concat already uses stat from newest combined file
6060
.pipe(concat('js/site.js')),
6161
vfs
@@ -89,7 +89,7 @@ module.exports = (src, dest, preview) => () => {
8989
})
9090
)
9191
.pipe(buffer())
92-
.pipe(uglify()),
92+
.pipe(uglify({ output: { comments: /^!/ } })),
9393
vfs.src(require.resolve('jquery/dist/jquery.min.js'), opts).pipe(concat('js/vendor/jquery.js')),
9494
vfs
9595
.src(['css/site.css', 'css/vendor/docsearch.css'], { ...opts, sourcemaps })

0 commit comments

Comments
 (0)