指南针插件与GRUNT一起使用 [英] Compass plugins to work with GRUNT
问题描述
使用终端编译我的sass / compass可以完美地工作,现在我已经将它用于一些项目,并且已经开始在这些项目中使用罗盘插件。不过,我还需要开始使用GRUNT自动化我的项目,但我还没有能够获得指南针插件与GRUNT sass插件grunt-contrib-sass一起工作。我没有必要使用这个插件,它只是我发现的第一个插件 - 有没有人知道如何得到这个工作或建议另一个插件?
所有帮助非常感谢..
•我想使用GRUNT来自动完成一些任务,包括处理我的SASS / Compass。
问题:
我有一个名为rgbapng的指南针插件,如我的配置文件中所示,导致GRUNT出错(如上图所示)
contrib-sass - 任何人都可以做到这一点 - 任何人都可以使用建议的插件来进行下注ter?
Compass Config.rb文件...
设置我在grunt.js文件中使用的grunt-contrib-sass
$ b
错误即时进入returnwatch /
更新:更新的grunt文件现在得到不同的错误信息见下面的内容
最后一个错误是通过将gruntfile.js中的路径从/ assets /更改为assets /来修复的。 scss现在编译w ith没有错误,但插件仍然无法正常工作。
解决方案
使用grunt-compass,包括sass编译。 h3>
需要的插件需要在您的sass代码中使用数组和导入语句。
不要忘记安装您需要的gem。指南针:
应用:
选项:
要求:['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:
指南针:{
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\\\
'
}
}
}
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..
解决方案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' } } }
这篇关于指南针插件与GRUNT一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!