-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
Sourcemaps not working #130
Comments
Strange. Something must have broken in an update or so. Would love to receive a PR for this. |
I did some further testing. I guess the reason is a problem with gulp-autoprefixer (as described here). Removing the piping to autoprefixer solves the problem (except having a new one without autoprefixer).
|
the same problem. |
I noticed that I have exactly the same problem. SourceMap only recognizes the main style file. It does not recognize the structure of individual .scss files. |
@berlindave Are you trying to say that this is a temp fix? I tried commenting out the line like you suggested but that didn't do anything. |
I had this problem a while ago, too. Some mixin was the problem. Maybe check that. |
Exactly.
I'm sorry to read that. Very strange. That's what I got after commenting out that line |
Tried the new NPX Gulp now, too. Same problem. Doing this: Node: 9.11.2 |
Happy to accept a fix via PR. I am on vacations.
… |
More clues: The style.css.map will be changed if I comment .pipe( autoprefixer( config.BROWSERS_LIST ) ). So it seems to be something wrong of sources when enabling autoprefixer. |
berlindave, your solution working good but I suppose this is an only temporary solution because you losing all browsers prefixes. Honestly not really useful :-/ |
I simply commented line 128 & 129 and things just worked :) Anything I should know with this quick fix? |
@AntonKeller fix worked for me on at least one test project. |
@AntonKeller Great, worked also for me in one test project so far! |
Yes, of course, it's just what I call a "cheesy workaround", far away from a real solution. |
Same here but solution by @AntonKeller is working fine and doesn't lose autoprefixer functionality. |
I had the same problem, and I solved it by adding |
Works fine with firefox, but not with chrome. Tried all of the solutions above to no avail. |
Doesnt work on FF nor Chrome. None of the above solutions worked unfortunately. |
Same here, none of the solutions worked for me. When I run npm start it compiles everything, but my browser doesn't see any of the source maps, it's simply pointing to styles.min.css. I think the problem here is that source map is created for regular unminified CSS, while there is not source map for a minified CSS. UPD: After some debugging, what worked for me is this version, the only problem is that I can't pass array with the BrowserList to autoprefixer:
|
I am interested in helping resolve this bug. I use WPGulp on a daily basis and have tried following the suggestions here and the only fix basically breaks Autoprefixer. Unless I am not understanding and there's a workaround for Autoprifixer? I tried re-writing the CSS task to troubleshoot and it quickly became a rabbit hole. Several packages needed to be added and swapped out. A new autoprefixer was needed. Etc. But I gave up because even then I couldn't get it to work. Is there anything in particular that is needed to move this forward? I would love to have sourcemaps 💯 |
As AntonKeller wrote
By passing false to includeContent, you're telling the sourcemaps to use the original files. According to the gulp-sourcemaps documentation "Including the content is the recommended way, because it "just works". When setting this to false you have to host the source files and set the correct sourceRoot." Since wpgulp isn't including a sourceRoot value, then of course this isn't going to work. commenting out .pipe( sourcemaps.init({ loadMaps: true }) ) is also the right thing to do because we don't want to load existing source maps. We want to load the sourcemaps that we just created. |
This bug still exists and fix from @AntonKeller worked for me as well! |
Any one find an alt fix? @tony-keller fix didn't work for me. |
This maybe a bonehead move, but during development, I changed my functions.php to enqueue the pre-minified style.css and it worked. |
Bug Report
Expected Behavior
Displaying the correct sources in Chrome Inspector.
Actual Behavior
Displaying just partly main scss file (which is wrong) and partly the compiled css file as sources.
Steps to Reproduce
npm start
node -v
: v10.12.0npm -v
: 6.4.1Then, specify:
Any suggestions what's going wrong?
Besides this little flaw I'm really glad working with WPGulp!
The text was updated successfully, but these errors were encountered: