Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to use aliases #212

Open
csabbee opened this issue Nov 13, 2023 · 1 comment
Open

Error when trying to use aliases #212

csabbee opened this issue Nov 13, 2023 · 1 comment

Comments

@csabbee
Copy link

csabbee commented Nov 13, 2023

Expected Behavior

  • The aliases should be resolved in the .scss files

Also a question: How does the config file work exactly? 馃 I don't seem to be able to use e.g the ignore property in the config file, typed-scss-modules only accepts that from CLI.

Current Behavior

  • Right now based on the setup in the test repo (link below) the type generation errors out because it cannot resolve the alias in the .scss file.

Possible Solution

Steps to Reproduce (for bugs)

Here is a repo with the minimal setup for the error

https://github.com/csabbee/test-typed-scss-monorepo

Context

I'm trying to generate type definitions for my stylesheets. I'm using a monorepo setup and separated the "design system" (e.g. variables that are common across) into their own root folder.
I set up vite with aliases so I can refer to this folder as @designToken and it works for that.

The problem comes when I try to setup typed-scss-modules to generate type definitions for my component library, because no matter how I'm trying to configure it, it cannot resolve the aliases in the .scss files.

Your Environment

Please refer to the test repo

  • Version used:
  • Operating System and versions:
  • Link to your project:
@skovy
Copy link
Owner

skovy commented Nov 26, 2023

@csabbee have you tried aliasPrefixes? If you change this line from aliases to aliasPrefixes that should work as you expect.

https://github.com/csabbee/test-typed-scss-monorepo/blob/ba49ede3af8b92ebb08819832cbe261cab6c8777/typed-scss-modules.config.js#L2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants