gulp-sourcemaps

Why inline source maps?

匆匆过客 提交于 2019-11-29 21:14:38
Today I learned that it is possible to include source maps directly into your minified JavaScript file instead of having them in a separate example.min.map file. I wonder: why would anybody want to do something like that ? The benefit of having source maps is clear to me: one can for example debug errors with the original, non-compressed source files while running the minified files. The benefit of minimization is also clear : the size of source files is greatly reduced, making it quicker for browsers to download. So why on Earth I would want to include the source maps into the minified file,

Why inline source maps?

假装没事ソ 提交于 2019-11-28 16:58:25
问题 Today I learned that it is possible to include source maps directly into your minified JavaScript file instead of having them in a separate example.min.map file. I wonder: why would anybody want to do something like that ? The benefit of having source maps is clear to me: one can for example debug errors with the original, non-compressed source files while running the minified files. The benefit of minimization is also clear : the size of source files is greatly reduced, making it quicker for

gulp: uglify and sourcemaps

别来无恙 提交于 2019-11-28 03:33:41
I am using gulp. I would like to having one or multiple JS files (say jQuery) to combine them in one, minify it, and write it to a distribution folder. This is how I do it: minifyJS(['/js/myModule.file1.js', '/js/myModule.file2.js'], '/dist/js', 'myModule') the function: function minifyJS(sourceFiles, destinationFolder, filenameRoot) { return gulp.src(sourceFiles) .pipe(plumber()) // .pipe(sourcemaps.init()) here ??? .pipe(concat(filenameRoot + '.js')) .pipe(sourcemaps.init()) // or here ??? .pipe(gulp.dest(destinationFolder)) // save .js .pipe(uglify({ preserveComments: 'license' })) .pipe

gulp: uglify and sourcemaps

谁都会走 提交于 2019-11-27 05:11:03
问题 I am using gulp. I would like to having one or multiple JS files (say jQuery) to combine them in one, minify it, and write it to a distribution folder. This is how I do it: minifyJS(['/js/myModule.file1.js', '/js/myModule.file2.js'], '/dist/js', 'myModule') the function: function minifyJS(sourceFiles, destinationFolder, filenameRoot) { return gulp.src(sourceFiles) .pipe(plumber()) // .pipe(sourcemaps.init()) here ??? .pipe(concat(filenameRoot + '.js')) .pipe(sourcemaps.init()) // or here ???