嗨,我是新来的咕噜咕噜,我在使用指南针时遇到问题。
这是我的Gruntfile:
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
//Read the package.json (optional)
pkg: grunt.file.readJSON('package.json'),
// Metadata.
meta: {
sassPath: 'templates/sass/',
cssPath: 'public/css/',
},
// Task configuration.
compass: {
dist: {
files: {
'<%= meta.cssPath %>*.css': '<%= meta.sassPath %>**/*.scss'
}
}
},
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-compass');
// Default task.
grunt.registerTask('default', ['compass']);
}
但是当我跑咕噜--verbose时我得到了这个:
...
Running "default" task
Running "compass" task
Running "compass:dist" (compass) task
Verifying property compass.dist exists in config...OK
Files: templates/sass/ie.scss, templates/sass/print.scss, templates/sass/screen.scss, templates/sass/style.scss -> public/css/*.css
Options: (none)
Nothing to compile. If you're trying to start a new project, you have left off the directory argument.
Run "compass -h" to get help.
Done, without errors.
所以它看起来像是看到了文件,甚至看到了把它们放在哪里......出了什么问题?
编辑:只是让人们知道最后的答案......我以为我之前没有成功尝试过,但是今天早上我最终得到了这个:
compass: {
dist: {
expand: true,
cwd: '<%= meta.scssPath %>',
src: ['{,*/}*.scss'],
dest: '<%= meta.cssPath %>',
ext: '.css'
}
},
编辑2:好的,因为我的生活不知道为什么,但只有当config.rb存在时才有效...为什么咕噜声使用罗盘配置是另一个问题...
答案 0 :(得分:1)
我认为问题是您的目标文件。您必须指定实际文件,而不是*.css
。尝试稍微调整一下配置:
compass: {
dist: {
files: {
'<%= meta.cssPath %>compiled.css': '<%= meta.sassPath %>**/*.scss'
}
}
}