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

@use rules must be written before any other rules. #556

Open
Hai-San opened this issue Dec 8, 2023 · 0 comments
Open

@use rules must be written before any other rules. #556

Hai-San opened this issue Dec 8, 2023 · 0 comments

Comments

@Hai-San
Copy link

Hai-San commented Dec 8, 2023

Project: Vue3 + Vite + Jest

Problem: I have many components that use SASS @use and I have a global SCSS with SCSS variables that are used in multiple components. In vue-jest the problem is that @import is forced to be used and SASS has a problem that we cannot use @import before @use

Current jest.config.js

  globals: {
    'vue-jest': {
      resources: {
        scss: ['myCssVars.scss'],
      },
    },
  },

What would be ideal?

  globals: {
    'vue-jest': {
      resources: {
        scss: `@use "myCssVars.scss" as *;`,
      },
    },
  },

I looked a lot and couldn't find a way to load the global SCSS with @use instead of @import.

I was able to configure normally in all other parts of the project, the only point that had a problem was with jest.

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

1 participant