Working on the mobile theme for Oxid eshop. I‘m having difficulties to set up a grunt configuration to compile the less files together with a sourcemap, so that I could work with Chrome developer tools. I have latest versions of grunt and npm modules. My Weserver for testing is XAMPP on Windows7.
The File structure (relevant part only)
out
-mobile
--src
---css
---less
As you can see the magic happens in out/mobile/src/less and out/mobile/src/css.
My Gruntfile.js: The less part looks like so:
// Compile specified less files
less: {
compile: {
options: {
// These paths are searched for @imports
paths: ["out/mobile/src/less"],
sourceMap: true,
sourceMapFilename: 'out/mobile/src/css/oxid.css.map',
sourceMapBasepath: 'out/mobile/src/css',
},
files: {
// target.css file: source.less file
"out/mobile/src/css/oxid.css": "out/mobile/src/less/oxid.less"
}
}
},
Which works: it outputs the css and the souremap.css.map
At the end of generated css file there is
/*# sourceMappingURL=oxid.css.map */
which looks ok to me
The filepaths in the sourcemap file look like so:
out/mobile/src/less/custom.less
which seems to be ok, too.
Now the chrome devtools ( chromium 31, Chrome 32) files are shown as .less files, not css which is not bad so far. Still when hovering over the filenames the paths are not correct, but something like this:
http://localhost/web/out/mobile/src/css/out/mobile/src/less/custom.less
As you can see it ads the less path to the css path which of course can‘t work.
What am I missing? Is there a way to have correct paths? Or is grunt-contrib-less /Chrome dev-tools not capable for this?
Hope for any ideas from the community here. Thank you.