If you are using angular-cli and faced some issue with setting up, SASS or SCSS file import.
Final code available here.

git clone --branch feature/sass-base https://github.com/seanlon/demo-angular-app/

Here is the configuration step.

Option 1: via command

  ng set defaults.styleExt scss

Option 2: via json
Open angular-cli.json

   "defaults": {
    "styleExt": "scss", //change from css to scss or sass

If all is setup correctly, you should be able to open app.component.ts without errors

    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./yourfilesass.scss'  ]

Then ,verify finally!


Leave a Reply

Your email address will not be published. Required fields are marked *