Skip to content

Commit

Permalink
don't uglify .min.js files in js/vendor folder
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Jun 25, 2021
1 parent e985510 commit b950165
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gulp.d/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = (src, dest, preview) => () => {
// NOTE concat already uses stat from newest combined file
.pipe(concat('js/site.js')),
vfs
.src('js/vendor/*.js', { ...opts, read: false })
.src('js/vendor/*([^.])?(.bundle).js', { ...opts, read: false })
.pipe(
// see https://gulpjs.org/recipes/browserify-multiple-destination.html
map((file, enc, next) => {
Expand Down Expand Up @@ -94,6 +94,9 @@ module.exports = (src, dest, preview) => () => {
)
.pipe(buffer())
.pipe(uglify()),
vfs
.src('js/vendor/*.min.js', opts)
.pipe(map((file, enc, next) => next(null, Object.assign(file, { extname: '' }, { extname: '.js' })))),
// NOTE use this statement to bundle a JavaScript library that cannot be browserified, like jQuery
//vfs.src(require.resolve('<package-name-or-require-path>'), opts).pipe(concat('js/vendor/<library-name>.js')),
vfs
Expand Down

0 comments on commit b950165

Please sign in to comment.