grails:生产环境所需的scss编译器 [英] grails: scss compiler required for production env

查看:139
本文介绍了grails:生产环境所需的scss编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Vaadin7和grails,我正面临着一个问题,即生产模式正常工作:

  :56:28 PM com.vaadin.server.VaadinServlet serveOnTheFlyCompiledScss 
INFO:在生产模式下未由sass编译器处理/VAADIN/themes/app/styles.css的请求

这是正常的,因为没有scss编译器对于css默认设置为prod,与dev模式不同。



我正在寻找一个grails黑客来获得相当于prod产生的maven工具:

 <插件> 
< groupId> org.codehaus.mojo< / groupId>
< artifactId> exec-maven-plugin< / artifactId>
< version> 1.2.1< / version>
<执行次数>
<执行>
<阶段> generate-sources< / phase>
<目标>
< goal> java< / goal>
< /目标>
<配置>
< classpathScope>编译< / classpathScope>
< mainClass> com.vaadin.sass.SassCompiler< / mainClass>
<参数>
< argument> src / main / webapp / VAADIN / themes / app / styles.scss< / argument>
< argument> src / main / webapp / VAADIN / themes / app / styles.css< / argument>
< / arguments>
< / configuration>
< /执行>
< /执行次数>
< / plugin>


解决方案

我已经添加了对SASS编译的支持。它可从7.1.9.1插件版本获得。它为prod环境运行war命令时下载需要的库并执行SASS编译。只需运行grails prod war即可运行汇编。 本教程中的更多信息

Using Vaadin7 with grails, i'm facing an issue to get the production mode working:

Dec 25, 2013 11:56:28 PM com.vaadin.server.VaadinServlet serveOnTheFlyCompiledScss
INFO: Request for /VAADIN/themes/app/styles.css not handled by sass compiler while in production mode

Which is normal since no scss compiler to css is set by default for prod unlike to dev mode.

I'm looking for a grails hack in order to get the equivalent of the maven tool for prod war generation:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>java</goal>
            </goals>
            <configuration>
                <classpathScope>compile</classpathScope>
                <mainClass>com.vaadin.sass.SassCompiler</mainClass>
                <arguments>
                    <argument>src/main/webapp/VAADIN/themes/app/styles.scss</argument>
                    <argument>src/main/webapp/VAADIN/themes/app/styles.css</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

解决方案

I have added support for SASS compilation. It is available from 7.1.9.1 plugin version. It downloads needed libraries and executes SASS compilation when running war command for prod environment. Just run "grails prod war" and it will run the compilation. More info in this tutorial.

这篇关于grails:生产环境所需的scss编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆