grails: scss compiler required for production env

淺唱寂寞╮ 提交于 2019-12-12 01:07:14

问题


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>

回答1:


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.




回答2:


As you can see here https://vaadin.com/forum#!/thread/3281129, you can do

"What we do is before we do the release, we run in debug mode so that SASS compiler automatically runs, and then we use our browser to request the URL /WEBAPPNAME/VAADIN/themes/YOURTHEMENAME/styles.css -- the compiler automatically runs and generates the styles.css for display in your browser, and then you can just save that file for release."



来源:https://stackoverflow.com/questions/20777850/grails-scss-compiler-required-for-production-env

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!