下面是我的代码:
@for $i from 1 through 3 {
.myclass-#{$i} {
/* ... */
}
}我使用的是webpack,我得到了这个错误:
ERROR in ./~/css-loader!./~/sass-loader!./~/postcss-loader?pack=cleaner!./path/style.scss
/path/to/my/file/style.scss:649:22: Unknown word
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser
@for $i from 1 through 3 {
.myclass-#{$i} {
^有没有办法解决这个问题?
我使用以下配置:
{
test: /\.scss$/,
loaders: ["style", "css", "sass", "postcss?pack=cleaner"]
},谢谢
发布于 2019-06-07 07:57:46
这是因为你有样式加载器和css加载器。我猜这导致了重新处理。删除样式加载器,它应该可以工作。至少这是我犯过类似错误的问题。
https://stackoverflow.com/questions/39180157
复制相似问题