privatenumber / vite-css-modules

Vite plugin for correct CSS Modules behavior
MIT License
53 stars 2 forks source link

Build breaks for selectors with the name `default` #9

Closed pffigueiredo closed 2 weeks ago

pffigueiredo commented 1 month ago

Problem

The build breaks if there is a selector with the name of default.

e.g.

.default{
...
}

#default{
...
}

Expected behavior

It should be able to handle it OR at least have that caveat in the docs?

Minimal reproduction URL

https://stackblitz.com/edit/vitejs-vite-mqxms1?file=src%2Fstyle.module.css

Version

v0.0.1

Node.js version

v18.20.30

Package manager

yarn

Operating system

macOS

Bugs are expected to be fixed by those affected by it

Compensating engineering work financially will speed up resolution

privatenumber commented 1 month ago

Nice catch! Thanks for the reproduction and showing interest in working on it. Feel free to ask me any questions if you need. Looking forward to the PR!

privatenumber commented 4 weeks ago

Looked into this and it doesn't seem like Vite w/o this plugin handles this either.

The difference is that it fails silently, which I think is less ideal.

To handle this, maybe we can add a config to disable default exports so the default named export can be used.

privatenumber commented 2 weeks ago

:tada: This issue has been resolved in version 1.6.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: