1
我搞清楚咕嚕聲和指南針。我正在使用'grunt-contrib-compass'。咕嚕/指南針產生空目標樣式表
當我運行 '咕嚕',和編輯我的青菜,咕嚕報道:
文件 「CSS/site.sass」 改變。 完成,沒有錯誤。
但是,我的目標樣式表是空的。
我想我缺少一個配置選項,告訴咕嚕在哪裏寫的CSS文件。但我一直無法弄清楚如何完成配置。
這是我有:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass : {
dist: {
options : {
sassDir: 'sass',
cssDir: 'css',
imageDir: 'img',
fontsDir: 'fonts',
files : ['sass/*.sass'] ,
watch : 'true',
debugInfo: 'true',
force : 'true'
}
}
},
watch: {
sass: {
files: ['css/*.css', '*.php', 'templates*.php'],
tasks: ['compass']
},
options : {
livereload: true,
files: [
'css/site.css', 'js/*.js', '*.html', 'templates/*.php',
'*.php', 'assets/images/**/*.{png,jpg,jpeg,gif,webp,svg}'
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default',['watch', 'compass']);
}
嘿本。我更新了我的問題中的配置。我已經安裝了ruby,compass和sass,並進行了測試和工作。恐怕,將選項對象包裹在'dist'中並沒有導致任何不同。 – davedave
Gruntfile中的這一行是不必要的:''grunt.registerTask('default',['watch','compass']);' - 刪除它並嘗試簡單地運行'grunt watch'。 (你的'compass'任務永遠不會運行,因爲'grunt watch'是一個阻塞任務)。 – Ben