How to add SCSS?
iblh opened this issue · 0 comments
iblh commented
Type of issue: question
If it's a bug: no
I have added css-loader node-sass sass-loader style-loader
and webpack.config.babel.js
is
// [...]
module: {
rules: [
// [...]
{
test: /\.(css|scss)$/,
use: [{
loader: 'style-loader', // creates style nodes from JS strings
}, {
loader: 'css-loader', // translates CSS into CommonJS
}, {
loader: 'sass-loader', // compiles Sass to CSS
}],
}],
},
// [...]
while I import a scss file, the yarn start
will throw err:
SyntaxError: /src/shared/component/style.scss: Unexpected token, expected ; (1:3)
> 1 | h1 {
| ^
3 | color: Cyan;
4 | }