Open joanscript opened 9 years ago
Try:
gulp.task('default', function() {
gulp.src('*.php')
.pipe(usemin({
js: [sourcemaps.init(), 'concat', uglify(), rev(), sourcemaps.write('.')]
}))
.pipe(gulp.dest('dist/'));
});
I got hung up on this for a long time too. Eventually it hit me and I finally noticed this small tidbit in the docs:
If exist used for modify files. If does not contain string 'concat', then it added as first member of pipeline
The apparent issue that @joanscript and I were struggling with is a misunderstanding of the default behaviour of usemin, which is to concat the source files before running the pipeline plugins (i.e.: generating sourcemaps). The result is a sourcemap of the resulting concatenated file - not as useful :).
@zont While I think this can be closed, better highlighting of the default behaviour would help steer people away from this sinkhole. Would you take a pull on the readme?
I am facing some problems generating sourcemaps using usemin. I am using the latest versions of the plugins. Here there is my task, which is very simple:
And here there is the output, a map without the mappings and names. userfile-652284cb.js.map
What am I doing wrong?