我正在Windows 10上使用grunt堆栈将我的scss文件构建为CSS; 我当前正在使用以下版本:
"grunt": "^1.0.3",
"grunt-cli": "^1.2.0",
"grunt-sass": "^3.0.1"
"node-sass": "^4.9.2"
我的咕unt任务配置如下:
const sass = require('node-sass');
module.exports = {
options: {
implementation: sass,
outputStyle: expanded,
sourceMap: true,
sourceComments: true
},
dist: {
files:[{
expand: true,
cwd: './sourceScss/',
src: ['**/*.scss'],
dest: './dist/assets/css/',
ext: '.temp.css'
}]
}
};
如果我在我的一个scss文件中写了一个错误(如超括号),我进入了终端:
Fatal error: Invalid CSS after "}": expected selector or at-rule, was "}"
但是我很确定,当我单独使用旧版本的grunt-sass(2.1.0)时,错误输出会更加详细:
>> File "source\Scss\_components.box.scss" changed.
Running "sass:dist" (sass) task
>> Error: Invalid CSS after "}": expected selector or at-rule, was "}"
>> on line 43 of source/Scss/_components.box.scss
>> from line 43 of source/Scss/app.scss
>> >> }}
>> ^
Warning: Use --force to continue.
我忘记了什么吗?我该如何找回呢?希望我能说清楚,谢谢。