developit / microbundle

📦 Zero-configuration bundler for tiny modules.
https://npm.im/microbundle
MIT License
8.06k stars 361 forks source link

SASS compiled prematurely #787

Closed heyymarco closed 3 years ago

heyymarco commented 3 years ago

I created my react liblary like this:

@use "~@mylib/index.scss";

$color: blue;
.hello {
    .world {
        color: #{$color};
        background: red;
    }
}

after running npm run build, the compiled file is like this:

@use "~@mylib/index.scss";
._XD_im ._RvYsd {
  color: blue;
  background: red; }

It seem the bundle didn't recognize new sass syntax like @use, @forward (but @import recognized well).

Is there any configuration to compile sass with a new sass compiler?

developit commented 3 years ago

Hi @heyymarco - Microbundle doesn't actually support SASS. Any SASS syntax that happens to work is just because it's a superset of what PostCSS supports, which is what Microbundle uses.

developit commented 3 years ago

I'm going to close this out since we're actively moving towards reducing our CSS support.

MartinDawson commented 3 years ago

This library is so annoying. At first glance it seems great but then you end up:

etc etc it goes on and on which makes it unbelievably useless and frustrating. It's a 'theoretically' great library and a useless one in any real application.

Instead of listing what you support on the readme, how about listing all the stuff that isn't supported too so people don't waste their time with this?

2nd time I've had to migrate an app/library away from this package.

arielvieira commented 2 years ago

@MartinDawson Do you mind sharing what are you using instead?

MartinDawson commented 2 years ago

@arielvieira I use and prefer parcel. It's amazing.

Edited by @rschristian: Don't come into OSS projects spreading toxicity.