I am acting according to sass-loader package: In my webconfig I have:
{
loaders: [
{
test: /\.scss$/,
loaders: ["style", "css", "sass"]
}
]
}
In the module I import the scss like this:
styles: require('./home.scss') ,
Scss file looks like this:
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
md-card {
font: 100% $font-stack;
color: $primary-color;
}
Unfortunately, when I run the app, the following happens:
ERROR in ./src/app/home/home.scss
Module parse failed: C:\src\app\home\home.scss Line 1: Unexpected token :
You may need an appropriate loader to handle this file type.
| $font-stack: Helvetica, sans-serif;
| $primary-color: #333;
|
@ ./src/app/home/home.component.ts 49:20-42
I think everything should be ok, when it fails then?
stylesin the component metadata definition object should be an array:styles: [require('./home.scss')],