Skip to content

SWC plugin not consistently checking renamed imports via yak_library_imports #297

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

Open
Mad-Kat opened this issue Mar 26, 2025 · 1 comment
Labels
bug Something isn't working swc plugin

Comments

@Mad-Kat
Copy link
Contributor

Mad-Kat commented Mar 26, 2025

Our SWC plugin currently implements yak_library_imports to track how our functions are imported and renamed. This allows us to properly handle cases like:

import {css as YakCSS} from "next-yak"

const Mixin = YakCSS`
  color: red;
`;

However, this import tracking mechanism isn't consistently applied throughout the plugin. There appear to be code paths where we're not checking the real import names, causing incorrect behavior with renamed imports.

@jantimon
Copy link
Collaborator

would be great to create a fixture test for this case

@Mad-Kat Mad-Kat added bug Something isn't working swc plugin labels Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working swc plugin
Development

No branches or pull requests

2 participants