Closed newtonianb closed 9 years ago
Interesting. Mind sharing your file structure and full gulp file?
Hi @mikestreety I've reproduced the problem here in this repo https://github.com/newtonianb/gulp-sourcemap-bug
You can see after running gulp css
in ./dist/assets/css/style.min.css
the sourcemap is part of the css file
Sorry, bit confused about what the problem is?
@mikestreety the problem is the sourcemap is getting placed inside the CSS !
body {
padding: 2px;
}
header {
padding: 2px;
}
/*# sourceMappingURL=main.css.map */
{
"version": 3,
"mappings": "AAAA,IAAK;EACD,OAAO,EAAE,GAAG",
"sources": ["../main.scss"],
"names": [],
"file": "main.css"
}
This is expected behaviour. Gulp ruby sass does allow you to pass in some parameters of you wish to have them as separate files. In my gulp file I only generate them if the dev flag is activated.
What if you set sourcemap: 'map'
as per things you've tried number 1?
I'm using
event-stream
so that I can compile SASS and merge it with CSS in one task. It's working great my only problem is thesourcemap
is getting merged inside the CSS.gulp code
source: main.SCSS
source: main2.css
output: style.min.css
Things I've tried
1) tried: setting sourcemap of rubySass to 'none' result: no difference
gulp-concat-sourcemap
, this creates my external sourcemap file but I still also have it inside mystyle.min.css
When I inspected the output of the resulting sourcemap I noticed this
Based on that it seems it's concatenating the .map file to the CSS which is the behavior we see. So I tried to filter it out.
3) tried: using
gulp-filter
to filter out the map file from being concatenated in the css result: no difference