Jan Zahradník
Jan Zahradník

Reputation: 2497

Include node_modules while compiling SCSS in VS 2017

I have a project with style file in wwwroot/css/site.scss. I've installed Web Compiler extension to create css file. It works until I reference some module, eg. @import "@material/button/mdc-button"; Error is File to import not found or unreadable.

Is it possible to include wwwroot/node_modules/ to compilerconfig.json? Is there any other way to get the job done?

Upvotes: 1

Views: 757

Answers (1)

Ron Peters
Ron Peters

Reputation: 215

After reading the source code for the Web Compiler and a little experimenting, I figured it out. Here is an example compilerconfig.json:

[
  {
    "outputFile": "styles/app-styles.css",
    "inputFile": "styles/app-styles.scss",
    "options": {
      "includePath": "node_modules"
    }
  }
]

Upvotes: 5

Related Questions