Getting incorrect path with sourcemaps, am I doing something wrong?
See original GitHub issueI’m very new to this package, so it’s quite possible I’m doing something wrong or that it isn’t a gulp-sass issue. Any help, or a nudge in the right direction, is greatly appreciated. 😃
That said:
I’m using gulp-sass with bootstrap-sass. I’m starting with a simple SCSS file, vendor.scss:
@import "../../../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss";
@import "custom.scss";
My custom.scss:
body {
background-color: pink;
}
And my gulp task:
gulp.task('css:vendor', function() {
return gulp.src('./client/features/shared/vendor.scss')
.pipe(sourcemaps.init())
.pipe(sass({ outputStyle: 'compressed', sourceComments: 'map' }))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./dist'));
});
Everything builds, the resulting CSS is what I would expect, but the sourcemap is off for the style from my custom.scss. It seems to be “stuck” on the last file that was processed from bootstrap’s package:
Any tips or suggestions?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:15
Top Results From Across the Web
gulp - Sourcemaps are in wrong location or have incorrect paths
in the gulp.src makes it that each matched file has the full path from the base, which then causes them to output with...
Read more >4 Reasons Why Your Source Maps are Broken - Sentry Blog
4 Reasons Why Your Source Maps are Broken · Missing or incorrect source map directive · Missing original source files · Bad source...
Read more >Bugsnag docs › API › React Native source map upload
Once a source map is uploaded it will only get applied to new error events. It does not get applied retroactively to existing...
Read more >Source Maps - SurviveJS
When your source code has gone through transformations, debugging in the browser becomes a problem. Source maps solve this problem by providing a...
Read more >Source Maps - Parcel
If you encounter incorrect mappings and want to debug these, we have built tools that can help you diagnose these issues. By running...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Have you tried using
outputStyle: 'compact'
instead ofcompressed
? I have the same issue when I usecompressed
, but changing it tocompact
fixes it. I haven’t found a proper solution for this issue, because I would prefer to usecompressed
.@Dellkan @MattHoneycutt I think I spoke too soon. I don’t think it’s a problem with gulp-sass anymore. I still had postcss running autoprefixer in the stream. When I commented that out and just ran gulp-sass with sourcemaps and
outputStyle: 'compressed'
it’s working fine.So it seems like the problem is postcss or autoprefixer. Will update as I find out more. The bootstrap breadcrumbs issue still holds true though as it messes up libsass itself.