grunt-contrib-less: sourceMap options generates incorrect sourceMapUrl
When calling lessc directly, the sourceMappingURL is correctly generated as:
.\node_modules\.bin\lessc.cmd ./src/css/modern.less ./src/css/modern.css `
>>> --source-map
/*# sourceMappingURL=modern.css.map */
when using grunt-contrib-less the sourceMappingURL is incorrect:
less: {
release: {
options: {
sourceMap: true
},
files: [
{ src: ["./src/css/modern.less"], dest: './src/css/modern.css' }
]
}
}
results in:
/*# sourceMappingURL=./src/css/modern.css.map */
I believe both of these should be generating the same sourceMappingURL.
This is important as my files are served from /css
, not /src/css/
, additionally I have many less files that need to be compiled to css, and each needs its own map file, therefore I cannot use the sourceMapUrl option in the grunt config.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 22 (1 by maintainers)
Commits related to this issue
- Added temp fix for issue with LESS source maps https://github.com/gruntjs/grunt-contrib-less/issues/236 — committed to dbeckwith/lsystems by dbeckwith 9 years ago
Same issue here. Thanks to @Wroud, this working for me:
I found solution
as result
/*# sourceMappingURL=blog.css.map */
for blog.less, and/*# sourceMappingURL=interface.css.map */
for interface.lessI can confirm that downgrading to
v0.12.0
got sourceMaps working correctly for my setup.I have a hunch that it has to with configs that use grunt expanded file mapping with the
cwd
option.Have you tried
- eventually combined with
? Then your references should point to ‘/less/main.less’ f.e.?