Skip to content

Handling Sass Imports #24

Open
Open
@sashafklein

Description

@sashafklein

My app has a Sass structure where individual component .scss files, collocated with the components they style, use Sass imports (@import ...) to pull in global variables from a centralized styles folder.

When I try using this package:

  plugins: [
    css({
      preprocessor: 'sass'
    })
  ]

I get the following error on doc build:

./src/components/Dropdown/Dropdown.scss 1:0
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
> @import 'styles/_sass-includes.scss';

I assume once I clear up this error, I may also have to set up the root folder for Webpack to search for these styles (eg something like the below):

  plugins: [
    css({
      preprocessor: 'sass',
      loaderOpts: {
        includePaths: [path.resolve(__dirname, 'src')]
      },
    })
  ]

But before I hit that error, I'm having trouble figuring out how to handle this one, and get the internal Sass dependencies to import.

Is this something this plugin supports?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions