【发布时间】:2015-07-24 12:16:37
【问题描述】:
我正在尝试在 Windows 上将 grunt watch t 与 SASS 一起使用,但每次都出现错误
Waiting...
OK
>> File "scss\main.scss" changed.
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 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. Use --force to continue.
Aborted due to warnings.
Completed in 0.769s at Wed May 13 2015 10:55:24 GMT+0200 (W. Europe Daylight Time)
我在这里找到了similar question,但这对我不起作用
我的 package.json:
{
"name": "Test",
"version": "1.0.0",
"description": "Test thingy",
"author": "Me",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-sass": "~0.3.0",
"grunt-contrib-watch": "~0.4.4"
}
}
我的 Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'css/style.css' : 'sass/style.scss'
}
}
},
watch: {
css: {
files: '**/*.scss',
tasks: ['sass'],
options: {
spawn: false
}
}
},
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default',['watch']);
}
软件版本:
grunt-cli v0.1.13
咕噜 v0.4.5
Sass 3.4.13(选择性史蒂夫)
ruby 2.2.2p95(2015-04-13 修订版 50295)[x64-mingw32]
指南针 1.0.3(北极星)
npm 2.7.4
节点 v0.12.2
我已经尝试更新所有软件包,甚至重新安装了所有组件,但这并没有帮助。谁能帮帮我?
【问题讨论】: