Angular 2 Node Bourbon Error

后端 未结 1 1823
慢半拍i
慢半拍i 2021-01-21 04:26
ERROR in ./node_modules/css-loader?
{\"sourceMap\":false,\"importLoaders\":1}!./node_modules/postcss-
loader/lib?{\"ident\":\"postcss\",\"sourceMap\":false}!./node_modul         


        
相关标签:
1条回答
  • 2021-01-21 05:26

    I came across this same issue when I had a node module that was referencing Burbon through an import statement. It turns out that version 7 of sass-loader has a feature where it doesn’t select the sass file over the same named JavaScript file.

    Link to the issues:

    • https://github.com/webpack-contrib/sass-loader/issues/556
    • https://github.com/angular/angular-cli/issues/10535

    There are two different work arounds to this issue. First you can add extension to your import statements, though I haven’t tested this approach personally.

    @import ‘./cool-sass-file’ becomes @import ‘./cool-sass-file.scss’
    

    The second route, which I verified was to roll back sass-loader to version 6.0.7

    npm install sass-loader@6.0.7
    

    Related question I am not able to use node-bourbon in the project

    0 讨论(0)
提交回复
热议问题