Node-sass does not understand tilde

后端 未结 2 1589
长情又很酷
长情又很酷 2021-02-20 00:55

Exploring the angular-cli for RC1 of Angular2 released recently I faced strange problem: node-sass within sass plugin in the angular-cli d

2条回答
  •  臣服心动
    2021-02-20 01:07

    I just had to install the node-sass-tilde-importer package:

    npm install node-sass-tilde-importer --save
    

    And then change my scss script to:

    node-sass --watch style.scss --importer=node_modules/node-sass-tilde-importer style.css
    

    Here are some relevant parts of my package.json file:

    {
    
      [...]
    
      "scripts": {
        "scss": "node-sass --watch style.scss --importer=node_modules/node-sass-tilde-importer style.css"
      },
    
      "dependencies": {
        "bootstrap": "^4.3.1",
        "bootstrap-material-design": "^4.1.2",
        "node-sass": "^4.12.0",
        "node-sass-tilde-importer": "^1.0.2"
      }
    }
    

提交回复
热议问题