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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined global scss variable #26

Open
zdjzce opened this issue Oct 8, 2023 · 3 comments
Open

undefined global scss variable #26

zdjzce opened this issue Oct 8, 2023 · 3 comments

Comments

@zdjzce
Copy link

zdjzce commented Oct 8, 2023

I would like to ask how vuePlugin handles style tags. I added a global SASS file in the main.ts entry point, but it didn't take effect when referenced in Vue and generated an error during building. The global style variables cannot be found. Can you please help me troubleshoot this issue?
image

@zdjzce
Copy link
Author

zdjzce commented Oct 8, 2023

VuePlugin processes the style tags in the template itself, right? I added esbuild-sass-plugin, but it doesn't seem to be used.

@apeschar
Copy link
Owner

apeschar commented Oct 9, 2023

I'm not sure if there's a way to use a global SASS file with the @vue/component-compiler that we use.

The first thing I'd do is look into the source of that module again and see if there's any way to get this to work without editing it.

The obvious workaround is to just import your global SASS wherever you need the variables. That'd be my preferred approach anyway since it's more explicit.

I'm not going to work on this myself right now, but clean PRs with tests are welcome.

@zdjzce
Copy link
Author

zdjzce commented Oct 10, 2023

I'm not sure if there's a way to use a global SASS file with the @vue/component-compiler that we use.

The first thing I'd do is look into the source of that module again and see if there's any way to get this to work without editing it.

The obvious workaround is to just import your global SASS wherever you need the variables. That'd be my preferred approach anyway since it's more explicit.

I'm not going to work on this myself right now, but clean PRs with tests are welcome.

ok , thank you~

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