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
autoprefixer not working when using lang="scss" #933
Comments
Removing |
I tried reverting various things (Gridsome 0.6.9) to try to see where this regression crept in. It looks like its the
So for anyone else coming across the issue, the problem is an incompatibility with |
So while this fixes my local issue, we should try to fix this in one of two ways:
|
Any news on this? I'm seeing the same behavior. More specifically, when I install sass-loader@7.1.0 or sass-loader@7.2.0 it works as expected, but version 7.3.0 does not. I think we are experiencing the same issue as is reported here: symfony/webpack-encore#638. It seems that sass-loader strips out comments, thus disabling the autoprefixer rule. |
Thinking about this some more, I guess it would be much nicer if we could just set autoprefixer options in gridsome.config.js. As far as I know, this is not possible at the moment. After some more poking around, I found that autoprefixer is required in gridsome/lib/webpack/createBaseConfig.js on line 298 (using gridsome@0.7.13). When you change that line from this:
... to this:
... it works great, also with the latest sass-loader version (8.0.2 at the moment of writing). I'm new to contributing to gridsome, so I have no idea how I could help realize the idea of global autoprefixer options. |
This appears to be resolved now, with the following versions:
|
Upgrading to sass-loader 8.0.2 results in the following error for me:
I’m using intended syntax with This seems to be the result of breaking changes in sass-loader v8.0.0:
|
@borisdiakur Is that related to autoprefixer in any way? It sounds like a separate problem to me. I suggest that you create a new issue for this. |
@marcvangend Actually there already is an issue for that: #750 It is somehow related as @danfwdmotion pointed out in his comment that upgrading to sass-loader 8 would resolve the autoprefixer issue. |
@borisdiakur Have you tried writing SCSS with <style lang="scss">? As opposed to SASS? Mine was a fresh project, with those versions, and using SCSS. Do all of your versions match these?
|
@danfwdmotion I prefer Sass over SCSS. It’s a matter of preference and I prefer Sass. SCSS works for you because SCSS is used with the default options of sass-loader. As soon as I choose Sass with |
Can we please keep this issue focused on the original topic, and avoid derailing it into a discussion about Sass dialects? Thank you. |
Is autoprefixer automatically included in Gridsome or must be installed separately? |
Description
When using scss, Autoprefixer does not prefix on
gridsome build
but does work ongridsome develop
.Steps to reproduce
Create a new gridsome project:
gridsome create gridsome_test_autoprefixer
Add the Sass packages needed:
npm install -D sass-loader node-sass
Edit the
src/pages/Index.vue
file and change the<style>
section to look like:Run
gridsome develop
Visit
http://localhost:8080/
Inspect the
home-links
element and confirm you can see the prefixeddisplay: -ms-grid
item:Expected result
Now run
gridsome build
Edit the css file in
dist/assets/css
Search for
.home-links
Expected result is that
display: -ms-grid
item is there.Actual result
Actual result is
display: -ms-grid
is not in the css file.Environment
The text was updated successfully, but these errors were encountered: