【发布时间】:2015-04-18 00:12:26
【问题描述】:
我正在使用基金会/jekyll boilerplate。
每当我运行 grunt 时,它只会在我的 style.css 中返回以下内容
[object Object]
它应该已经处理了基础文件中的 scss。
这里是 gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
includePaths: ['bower_components/foundation/scss']
},
dist: {
options: {
outputStyle: 'compressed'
},
files: {
'css/style.css': 'scss/style.scss'
}
}
},
watch: {
grunt: { files: ['Gruntfile.js'] },
sass: {
files: 'scss/**/*.scss',
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('build', ['sass']);
grunt.registerTask('default', ['build','watch']);
}
我唯一要做的就是 npm install node-sass。 我运行 grunt,我的 style.css 中唯一的代码是 [object, Object]
编辑:运行npm install grunt-sass,
css 现在可以很好地编译了。
【问题讨论】: