Skip to content

vite CSS preprocess doesn't recognize $lib alias in monorepo #1986

@farin

Description

@farin

Describe the bug

When <style> part in svelte component contains import with $lib alias, eg:

<style lang="scss">
  @import '$lib/styles/mixins';
  
  ...
</style>

then VSCode shows error on file

Error in referenced file
Error: Can't find stylesheet to import.
  ╷
2 │   @import '$lib/styles/mixins';
  │           ^^^^^^^^^^^^^^^^^^^^

Although application work fine (and alias is correctly preprocessed by default Vite preprocessor

Reproduction

Default skeleton app is enough, just enable SASS, put one scss file to /src/lib/ and import from any component as described above.

Expected behaviour

No list ./ file validation error.

System Info

  • OS: MacOS
  • IDE: VSCode

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationupstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions