From: Daniel Mulholland Date: Sat, 29 Dec 2018 10:02:00 +0000 (+1300) Subject: add source map for compiled javascript X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1a62b20dd5533c997a6b608a4281fd02298b8f2e;p=eg-antora.git add source map for compiled javascript --- diff --git a/gulp.d/tasks/build.js b/gulp.d/tasks/build.js index 6f2db23..226a230 100644 --- a/gulp.d/tasks/build.js +++ b/gulp.d/tasks/build.js @@ -17,6 +17,7 @@ const postcssImport = require('postcss-import') const postcssUrl = require('postcss-url') const postcssVar = require('postcss-custom-properties') const uglify = require('gulp-uglify') +const sourcemaps = require('gulp-sourcemaps') const vfs = require('vinyl-fs') module.exports = (src, dest, preview) => () => { @@ -45,8 +46,10 @@ module.exports = (src, dest, preview) => () => { return merge( vfs .src('js/+([0-9])-*.js', opts) + .pipe(sourcemaps.init()) .pipe(uglify()) - .pipe(concat('js/site.js')), + .pipe(concat('js/site.js')) + .pipe(sourcemaps.write('.')), vfs .src('js/vendor/*.js', { ...opts, read: false }) .pipe( diff --git a/package.json b/package.json index 0ba8142..8014891 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "gulp-eslint": "~5.0", "gulp-imagemin": "~5.0", "gulp-postcss": "~8.0", + "gulp-sourcemaps": "~2.6", "gulp-stylelint": "~8.0", "gulp-uglify": "~3.0", "gulp-vinyl-zip": "~2.1 >=2.1.2",