Skip to content

Using the global variable problem in Vite #267

Open
@xiaoxustudio

Description

@xiaoxustudio

Describe the bug
Import the global variable in Vite, when the variable is used in another file, the prompt invalidates

To Reproduce
Steps to reproduce the behavior:

  1. The scss file of a global variable is configured in vite
  2. Use global variables in other scss files
    3.Yes, it's wrong

Expected behavior
It should make no errors and parse the scss file correctly

Screenshots
global variable file(global variable are defined )
image
head.scss(using global variable)
image
After importing, using it throws an error
image

I put the variable in the head file and it worked fine

Desktop (please complete the following information):

  • OS: Windows
  • node Version: v20.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions