Gulp task for appending external SourceMap to the end of js-bundle (those within a //# sourceMappingURL=... declaration) into base64-encoded data URI strings.
Install with npm
npm install gulp-inline-sourcemap --save-dev
var gulp = require('gulp');
var inlineSourceMap = require('gulp-inline-sourcemap');
//basic example
gulp.task('build', function () {
return gulp.src('./*.js')
.pipe(inlineSourceMap())
.pipe(gulp.dest('./public/js'));
});
...
//example with options
gulp.task('build', function () {
return gulp.src('./*.js')
.pipe(inlineSourceMap({
baseDir: 'public',
debug: true
}))
.pipe(gulp.dest('./public/js'));
});
-
baseDir
(String)
If you have absolute paths, the path specified in this option will be used as the base directory (relative to gulpfile). -
debug
(Boolean)
Enable log to console.