您是否在gruntfile中添加了require選項?
參見: http://ericdfields.com/post/installing-compass-frameworks-in-a-yeoman-project
確保你有你的initConfig正確的 '手錶' 塊:
grunt.initConfig({
// Project settings
yeoman: appConfig,
// Watches files for changes and runs tasks based on the changed files
watch: {
...
compass: {
files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
tasks: ['compass:server', 'autoprefixer']
}, ...
而且還指南針定義表如下:
// Compiles Sass to CSS and generates necessary files if requested
compass: {
options: {
sassDir: '<%= yeoman.app %>/styles',
cssDir: '.tmp/styles',
generatedImagesDir: '.tmp/images/generated',
imagesDir: '<%= yeoman.app %>/images',
javascriptsDir: '<%= yeoman.app %>/scripts',
fontsDir: '<%= yeoman.app %>/styles/fonts',
importPath: './bower_components',
httpImagesPath: '/images',
httpGeneratedImagesPath: '/images/generated',
httpFontsPath: '/styles/fonts',
relativeAssets: false,
assetCacheBuster: false,
raw: 'Sass::Script::Number.precision = 10\n'
},
dist: {
options: {
generatedImagesDir: '<%= yeoman.dist %>/images/generated'
}
},
server: {
options: {
debugInfo: true
}
}
},
而且最後,併發任務定義如下:
// Run some tasks in parallel to speed up the build process
concurrent: {
server: [
'compass:server'
],
test: [
'compass'
],
dist: [
'compass:dist',
'imagemin',
'svgmin'
]
},
我相信它被添加到這個Sass塊中,對吧? 'SASS:{ \t \t \t DIST:{ \t \t \t \t選項:{ \t \t \t \t \t樣式: '擴大',//膨脹或嵌套的或緊湊的或壓縮的 \t \t \t \t \t loadPath:「<%= app %>/bower_components/foundation/scss', \t \t \t \t \t指南針:true, \t \t \t \t \t安靜:真 \t \t \t \t}, \t \t \t \t文件:{ \t \t \t \t \t '<%= app %> /css/app.css': '<%= app %> /scss/app.scss' \t \t \t \t} \t \t \t} \t \t},' – realph 2014-08-29 15:21:11
嗯。我猜不是。我已經使用自己的指南針設置更新了我的帖子,以防萬一。 – Gopherkhan 2014-08-29 17:49:33