我试图在grunt中使用sass。我已经将ruby、sass和grunt安装到了我的路径中。
它们的版本分别是,
node: 0.10.20
npm: 1.3.11
grunt-cli: 0.1.13
grunt: 0.4.5
sass: 3.4.4
我的package json文件如下,
"private": true,
"devDependencies": {
"express": "4.x",
"grunt": "~0.4.1",
"grunt-contrib-sass": "~0.3.0",
"grunt-contrib-watch": "~0.4.4"
}
我的Grunt文件如下:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
files: {
'style/style.css' : 'sass/home.scss'
}
}
},
watch: {
css: {
files: '**/*.scss',
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default',['watch']);
}
现在如果我尝试运行 "grunt" 命令,会收到以下错误。有什么帮助吗?
运行:grunt、grunt watch 或 grunt sass
错误:
Running "sass:dist" (sass) task
Error: Error generating source map: couldn't determine public URL for the source
stylesheet.
No filename is available so there's nothing for the source map to link
to.
on line of standard input
Use --trace for backtrace.
Warning: Error: Error generating source map: couldn't determine public URL for t
he source stylesheet.
No filename is available so there's nothing for the source map to link
to.
on line of standard input
Use --trace for backtrace. Use --force to continue.
Aborted due to warnings.
有什么想法吗?
options: {sourcemap: 'none'}
。我最后一个问题是你的SASS里有什么导入,它是什么样子的? - Stefan Dorunga