Allow to customize the “sources” field in the sourcemaps. #283
Open
Description
Currently the sources
field in sourcemaps is always relative to the sources. In my case it looks somewhat ugly:
../../../../src/main/webapp/home/scripts/home.js
I’m including the sources with sourcesContent
and not serving the actual sources (and if I were serving them, it wouldn’t be at that path...).
Is there an option to tweak that relative path? uglify.js mentions -p
/--prefix
, but as far as I can see it’s not available from this plugin. I also tried sourceMapRoot
, but it did nothing.
My base setup is like this:
uglify: {
options: {
sourceMap: true,
sourceMapIncludeSources: true,
compress: true,
mangle: true
},
build: {
files: [{
/* Minify all but vendor scripts */
expand: true,
cwd: 'src/main/webapp/home',
src: ['scripts/**/*.js', '!scripts/vendor/**'],
dest: 'target/grunt/home'
}]
}
}
Metadata
Assignees
Labels
No labels