指南针插件与GRUNT一起使用

时间:2013-12-23 01:29:42

标签: sass gruntjs compass-sass

使用终端编译我的sass /指南针工作完美,我现在已经将它用于一些项目并且已经开始在这些项目中使用指南针插件。然而,我还需要使用GRUNT开始自动化我的项目,但我还没有能够使用指南针插件来处理GRUNT sass插件“grunt-contrib-sass”..我不必使用这个插件,它只是我发现的第一个 - 有谁知道如何让这个工作或建议另一个插件?

  

非常感谢所有帮助。


•我想使用GRUNT自动执行某些任务,包括处理我的SASS /指南针。

  

问题:

•我的配置文件中有一个名为“rgbapng”的指南针插件导致GRUNT错误输出(如上图所示)

  

问题:

•如何让这个指南针插件与GRUNTS“grunt-contrib-sass”一起使用 - 还有其他人这样做过 - 有没有人建议插件更好用?

Compass Config.rb文件...

Config file for my sass/compass setup - works perfectly

我在我的grunt.js文件中使用grunt-contrib-sass的设置

grunt-contrib-sass setup im using

我在returnwatch /

中的错误

terminal error


更新:更新的grunt文件现在获得不同的错误消息,见下文

enter image description here enter image description here

最后一个错误是通过将gruntfile.js中的路径从/ assets /更改为assets /来修复的。但是scss现在编译时没有错误,但插件仍然不起作用..

1 个答案:

答案 0 :(得分:3)

使用grunt-compass,包括sass编译。

必需的插件在你的sass代码中输入require数组和import语句 别忘了安装你需要的宝石。

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'
    }
  }
}