Closed iryan2 closed 4 months ago
Latest commit: b1d2e0f7df8a97a8545fa9dbbd1538d79e6f9f02
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Currently, when
@swc/plugin-emotion
is used on Windows, it produces invalid CSS class names. Apparently this is an unsolved issue for Rust. In this PR I've updated the calculation of the[filename]
labelFormat
such that it handles both the Windows path, which includes the full path to the file, including backslashes, and the Unix path (which was working fine to begin with).I have set up a minimal repo for reproducing the issue and verifying the fix. The issue can be reproduced on the
main
branch, and the fix can be verified on thefix
branch. Thefix
branch replaces the compiledswc_plugin_emotion.wasm
from@swc/plugin-emotion
npm package with one I built myself via my fork of this repo.Before
After
Fixes #327