问题
Using terminal to compile my sass/compass works perfectly, Ive used it for a few projects now and have started using compass plugins within these projects. However I also need to start automating my projects using GRUNT but I havent been able to get compass plugins to work with the GRUNT sass plugin "grunt-contrib-sass".. I dont have to use this plugin its just the first I found - does anyone know how to get this to work or suggest another plugin?
All help is very much appreciated..
• I want to use GRUNT to automate some tasks including the processing of my SASS/Compass.
Problem:
• I have a compass plugin called "rgbapng" as seen in my config file that causes GRUNT to error out (as seen in the last image)
Question:
• How to I get this compass plugin to work with GRUNTS "grunt-contrib-sass" - has anyone else done this - has anyone a suggested plugin that works better?
Compass Config.rb file...

The settings Im using in my grunt.js file for grunt-contrib-sass

The Error im getting in returnwatch/

UPDATE: updated grunt file now get a different error message see below


The last error was fixed by changing the paths in the gruntfile.js from /assets/ to assets/ .. however the scss now compiles with no errors but the plugin still doesn't work..
回答1:
use grunt-compass, sass compiling is included.
Required plugins go in require array and import statements in your sass code.
Dont forget to install the gem you need.
compass:
app:
options:
require: ['compass-h5bp', 'ceaser-easing'] #to use compass libs
sassDir: 'assets/css'
cssDir: 'assets/css'
imagesDir: 'assets/img'
fontsDir: 'assets/font'
httpPath: "/"
relativeAssets: true
boring: true
debugInfo: true
outputStyle: 'compressed'
raw: 'preferred_syntax = :sass\n'
js code:
compass: {
app: {
options: {
require: ['compass-h5bp', 'ceaser-easing'],
sassDir: 'assets/css',
cssDir: 'assets/css',
imagesDir: 'assets/img',
fontsDir: 'assets/font',
httpPath: "/",
relativeAssets: true,
boring: true,
debugInfo: true,
outputStyle: 'compressed',
raw: 'preferred_syntax = :sass\n'
}
}
}
来源:https://stackoverflow.com/questions/20735910/compass-plugins-to-work-with-grunt