Skip to content

Commit

Permalink
Merge pull request #11394 from ncoden/chore/dist-js-plugins-sourcemaps
Browse files Browse the repository at this point in the history
chore: update sourcemaps of distributed JS plugins
  • Loading branch information
ncoden committed Jul 10, 2018
2 parents 137ce79 + 09a46c6 commit 402962f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions gulp/tasks/deploy.js
Expand Up @@ -20,6 +20,7 @@ gulp.task('deploy', gulp.series('deploy:prompt', 'deploy:version', 'deploy:dist'

gulp.task('deploy:prep', gulp.series('deploy:prompt', 'deploy:version', 'deploy:dist', 'deploy:plugins', 'deploy:settings'));
gulp.task('deploy:dist', gulp.series('sass:foundation', 'javascript:foundation', 'deploy:dist:files'));
gulp.task('deploy:plugins', gulp.series('deploy:plugins:sources', 'deploy:plugins:sourcemaps'));

gulp.task('deploy:prompt', function(cb) {
inquirer.prompt([{
Expand Down Expand Up @@ -93,11 +94,19 @@ gulp.task('deploy:dist:files', function() {
});

// Copies standalone JavaScript plugins to dist/ folder
gulp.task('deploy:plugins', function() {
gulp.task('deploy:plugins:sources', function () {
return gulp.src('_build/assets/js/plugins/*.js')
.pipe(gulp.dest('dist/js/plugins'))
.pipe(uglify())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist/js/plugins'));
});

// Copies standalone JavaScript plugins sourcemaps to dist/ folder
gulp.task('deploy:plugins:sourcemaps', function () {
return gulp.src('_build/assets/js/plugins/*.js.map')
.pipe(gulp.dest('dist/js/plugins'));
});

Expand Down

0 comments on commit 402962f

Please sign in to comment.