Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Compilation 使用Compass、不同的输出样式和";编译多个样式表;。";文件名_Compilation_Config_Compass Sass_Minify - Fatal编程技术网

Compilation 使用Compass、不同的输出样式和";编译多个样式表;。";文件名

Compilation 使用Compass、不同的输出样式和";编译多个样式表;。";文件名,compilation,config,compass-sass,minify,Compilation,Config,Compass Sass,Minify,摘要:使用Compass,需要使用不同的输出样式和文件名编译两次SASS样式表 我将此作为我的config.rb: http_path = "/" css_dir = "assets/css" sass_dir = "assets/sass" # …more stuff… # output_style = :expanded 它完美地编译了 assets ┗ sass ┣ style1.scss ┗

摘要:使用Compass,需要使用不同的输出样式和文件名编译两次SASS样式表

我将此作为我的config.rb:

http_path           = "/"
css_dir             = "assets/css"
sass_dir            = "assets/sass"
# …more stuff… #
output_style        = :expanded
它完美地编译了

assets 
┗ sass
   ┣ style1.scss
   ┗ style2.scss

我需要完成如下输出:

assets 
┗ css
   ┣ style1.css
   ┣ style1.min.css
   ┣ style2.css
   ┗ style2.min.css
其中“.min.css”文件显然包含缩小的css

所以我想我需要想出一些像:

on_stylesheet_saved do |filename|
    # switch output_style to :compressed
    # compile again and include ".min" into file name
end
有谁能为我提供一个基本的样本,说明如何做到这一点? 到目前为止,我还没有弄乱ruby,但通过我对这个主题的阅读,我已经基本了解了它 非常感谢

我建议,或者定制脚本。如果您更倾向于Ruby,也可以使用它。

(由于rep的原因,无法发表评论)

为了回答凯文·萨特尔的问题,古尔普也可以做这项工作。这有点像grunt,但在gulp中,您得到的是配置之上的代码,而grunt主要是配置,没有(或几乎没有)代码

许多文章说,人们在一天多的时间里学会了咕噜,而他们只花了一个小时学会了咕噜

这取决于你

PS:是的,那篇文章是2013年的,但回答它可能会帮助有相同或类似问题的人

on_stylesheet_saved do |filename|
    # switch output_style to :compressed
    # compile again and include ".min" into file name
end