ritwickdey / vscode-live-sass-compiler

Compile Sass or Scss file to CSS at realtime with live browser reload feature.
https://ritwickdey.github.io/vscode-live-sass-compiler/
MIT License
657 stars 168 forks source link

Autoprefix setting not work with some Browserslist setting #481

Closed liangwuweb closed 3 years ago

liangwuweb commented 3 years ago

I found there is some problem with the auto prefix setting when I use some browserslist setting to target browsers.

When I use the default setting on the documentation(see below), the autoprefix will work and I can see the generated css files has prefix add the the css properties.

"liveSassCompile.settings.autoprefix": [
    "> 1%",
    "last 2 versions"
  ]

When I use some setting from the full list: https://github.com/browserslist/browserslist#full-list, the compiler cannot compile the scss file to css. For example, when I put the below setting, the compiler will stop working.

"liveSassCompile.settings.autoprefix": [
   ">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
  ]

The out put will only show below message, and it stop compiling:

Change Detected...
style.scss
--------------------

I assume that's because the autoprefix setting is wrong, and it causes the compiler stop to work.

glenn2223 commented 3 years ago

This extension is no longer maintained, I'd suggest switching to my updated version. You can find it on the VS Code marketplace here.


If you would like to continue to use this unmaintained version then:

The browserslist version is 2.11.3 so you need to use settings from here

Also, this extension doesn't catch the error that's thrown when an incorrect browserslist setting is entered - in this case not dead and also possibly the all suffix. This means the extension will crash when an incorrect setting is encountered.

liangwuweb commented 3 years ago

@glenn2223 Thanks, Glenn! That's what I am thinking, it crashed when an incorrect setting is encountered. I will switch to the new version. One question, does your new version compatible with the browserslist setting?

Also, you might encourage users to move to the new version when they downloading the old extension. Just my thoughts.

glenn2223 commented 3 years ago

does your new version compatible with the browserslist setting?

Yes, it uses pretty much the latest versions of autoprefixer, and thus browserslist (v5 - which is in alpha - uses the latest).

Also, you might encourage users to move to the new version when they downloading the old extension. Just my thoughts.

Unfortunately I have to control over Ritwick's extension so I can't inform them in any way

liangwuweb commented 3 years ago

Sounds great! Thanks.