我正在使用 Grunt 来查看我的 sass 文件集,并在它们使用 grunt-contrib-sass 插件更改时编译为 css。我将 sourcemap 设置为 true,因为我发现此功能在 css 调试中非常有用。
但是我收到以下错误消息:
Running "sass:uk" (sass) task
WARNING: Couldn't determine public URL for "C:\Ruby193\lib\ruby\gems\1.9.1\gems\compass-core-1.0.0.alpha.19\stylesheets\compass\reset\_utilities.scss" while generating sourcemap.
Without a public URL, there's nothing for the source map to link to.
任何想法为什么会发生这种情况?
这是我的 Gruntfile:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
files: ['./style/v4/sass/**/*.scss'],
tasks: ['sass:uk'],
options: {
spawn: false,
},
},
sass: {
uk: {
options: {
style: 'compressed',
sourcemap: true,
compass: true
},
files: {'./style/v4/css/screen.css': './style/v4/sass/screen.scss'}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.registerTask('default', ['watch']);
};
谢谢