Vaadin 瓦丁·萨斯;“在飞行中”;使用Spring Boot时编译+;瓦丁泉

Vaadin 瓦丁·萨斯;“在飞行中”;使用Spring Boot时编译+;瓦丁泉,vaadin,vaadin7,vaadin4spring,Vaadin,Vaadin7,Vaadin4spring,当您使用SpringBoot在调试模式下运行时,是否可以动态地进行sass编译?怎么用? 现在我每次都需要手工编译,这样的开发效率不高。 这对谁有用吗 提前非常感谢你能告诉我这件事 Fran您可以将以下行添加到pom.xml中,以便将sass编译为css <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId

当您使用SpringBoot在调试模式下运行时,是否可以动态地进行sass编译?怎么用? 现在我每次都需要手工编译,这样的开发效率不高。 这对谁有用吗

提前非常感谢你能告诉我这件事


Fran

您可以将以下行添加到pom.xml中,以便将sass编译为css

<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/heijunka/styles.scss</argument>
                    <argument>src/main/webapp/VAADIN/themes/heijunka/styles.css</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

org.codehaus.mojo
execmaven插件
1.2.1
生成源
JAVA
编译
com.vaadin.sass.SassCompiler
src/main/webapp/VAADIN/themes/heijunka/styles.scss
src/main/webapp/VAADIN/themes/heijunka/styles.css

没有使用Spring Boot,但是默认情况下处于调试/开发模式的任何示例项目都会动态编译主题,不会出现任何问题。您是否在
web.xml
@VaadinServletConfiguration
中仔细检查了
productionMode=false
?感谢@Morfic的评论,但是使用Spring boot,此模式和其他vaadin参数在“application.properties”文件中配置。设置在那里,仍然没有效果。我甚至在日志中看到“Vaadin正在调试模式下运行”。所以这应该是很好的。你能分享一个示例项目来说明你的问题吗?我刚刚在上创建了一个简单的项目,制作了一个带有标签的基本用户界面&添加了一个主题,可以改变文本的颜色,一切都是开箱即用的。如果我修改了颜色并刷新了页面,它会立即接受更改…感谢@Morfic提供的信息。请问您是如何创建和放置主题的?也许我的问题就在这里。我的项目也退出了start.spring.io,选择了web和vaadin选项。然后我在“src/main/resources”中放置了一个“VAADIN/themes/mytheme文件夹”,用“@Theme(“mytheme”)注释我的UI类如果我更改了scss文件中的某些内容,我需要每次编译,然后创建项目。根据文档,主题应该位于
src/main/webapp/VAADIN/themes
谢谢,但Spring Boot不需要这样做