How to use absolute path to import custom scss, when using react + webpack?

后端 未结 4 1456
北恋
北恋 2021-02-05 04:47

Inside a scss file, I\'m trying to import custom, widely used chunk of scss (in a React/SASS/Webpack stack).

So that I can use a shared mixin.

Let\'s say I\'m cr

4条回答
  •  故里飘歌
    2021-02-05 05:32

    Found. Actually you can configure sass-loader in webpack.config.json, as described here : https://github.com/jtangelder/sass-loader

    Here is the relevant part :

    sassLoader: {
       includePaths: [path.resolve(__dirname, "./some-folder")]
    }
    

提交回复
热议问题