yibn2008 / fast-sass-loader

High performance sass loader for webpack
250 stars 38 forks source link

Variables imported in the top file cannot get by files followed #54

Closed jasonYoge closed 5 years ago

jasonYoge commented 5 years ago

Hi there,I have used fast-sass-loader in my webpack config file to improve sass compiling performance. My directories structure like this:

/common
  index-common.scss
/page
   /sop
       /components
         CircleChart.scss
     index.scss

In the file /common/index-common.scss,I set a variable like this: $sop-color-3: #999999;.

/common/index-common.scss
$sop-color-3: #999999;

And then, imported the index-common.scss file in /page/sop/index.scss.

/page/sop/index.scss
@import '../../common/index-common.scss'

/page/sop/index.scss is the entry point of all files.CircleChart is component file imported by entry point. When I used variable $sop-color-3,some errors occured like this. image Is there something wrong in my config.js file?Or I have missed something.

{
        test: /\.(sa|sc|c)ss$/u,
        use: [
          MiniCssExtractPlugin.loader,
          'css-loader',
          'fast-sass-loader'
        ],
      },