-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
source maps are incorrect when compiling from SCSS #55
Comments
I have the exact same problem with LESS files right now, if I remove |
Did the same thing as @mareksupruniuk, and it works. But it's still an issue on this package, I'll try to fix it. |
This fixes issue sindresorhus#55 for me with css generated from less. Code adapted from `gulp-postcss`
I have the same issue, too... Source maps are only properly generated without autoprefixer |
+1. |
+1 |
1 similar comment
+1 |
From autoprefixer #731
|
+1 |
1 similar comment
+1 |
+1 I have experimented with a reduced test case as I was facing this issue. I am getting scss files that are nested in a sub-directory not generating correct sourcemaps. Specifically the problem seems to lie with the 'sources' array. I created a quick repo to show the output and dir structure: https://github.com/freemagee/nested-sass-sourcemaps/ With the prefix function running, the output sourcemap will be:
If the prefix function is commented out of my gulp task the output will be:
|
+1 |
+1 I'm thinking @freemagee might be on to something. I pulled my Sass files out of their sub-directory, and that fixed my issue. |
A solution I am happy with at the moment is to use CSSNext along with PostCSS to prefix. So I use sass to process my sourcefiles into a css file within Gulp. I then pipe that into postcss using the postcss-cssnext plugin. CSSNext has autoprefixer as part of it. I am not an expert on this yet as I only tried it this week. But I have seen my nested scss files get a proper sourcemap now, which is what I needed. It was quite a simple change and has helped me. My Gulpfile might provide insight to some, see the 'postCSS' task: https://github.com/freemagee/nested-sass-sourcemaps/blob/master/gulpfile.js |
@freemagee, thanks for posting your solution. |
I've tried a different workaround (a task for sass and one for prefix the output css) but it didn't work for me. I've noticed that there is a new version of autoprefixer, there is a solution for this problem now? |
I believe this pull request fixes this bug: #92 |
If an issue as essential as this one hasn't been fixed in more than 2 years, imo usage of this should be discouraged and the plugin marked as deprecated. |
@franktopel Agreed. The "It's a downstream problem" excuse is not much consolation when people depend on something to work. That's why most people have gone back to Grunt. Very embarrassing after I recommended Gulp at work. Never again. |
@franktopel @alvint Agreed. I fixed the bug and pushed a PR, but it's not accepted. From https://www.npmjs.com/package/gulp-sourcemaps
As pointed out earlier in this thread, the files in the sources array are file names only, with no path information. So it's a problem that gulp-sourcemaps is discarding path information in source files. It's fixed by #92. |
Sorry--this is actually the same as issue 54 but I'm not sure how to reopen it. As mentioned there, the problem does not lie with the other plugins in the compile chain. The issue is with this plugin because it relies on
gulp-postcss
, which is the ultimate culprit. The issue is easily reproduced withgulp-autoprefixer
and any number of other plugins.I have this Gulp code which compiles three SCSS files (first.scss, last.scss, and app.scss). All plugins are gulp-sourcemaps compatible:
When autoprefixer is commented out, the source maps are produced properly:
When autoprefixer is enabled, the source maps are incorrect and point to nonexistent CSS files:
The text was updated successfully, but these errors were encountered: