Created
November 27, 2019 07:12
-
-
Save PezCoder/3a79df6764ad304781c9506d6229055c to your computer and use it in GitHub Desktop.
Generating source maps with Gulp, Browserify, Uglify & Babel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sourcemaps = require('gulp-sourcemaps'); | |
browserify(path, { | |
paths: ['./node_modules'], | |
// Enables source maps | |
debug: true, | |
}) | |
// Any babel config may come here | |
// --- | |
// Initialises & writes source maps | |
.pipe(sourcemaps.init({ loadMaps: true })) | |
.pipe(uglify()) | |
.pipe(sourcemaps.write('.')) | |
// Used to export generated minified files & source maps | |
.pipe(gulp.dest('./web/js')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment