diff options
author | Vitaly Takmazov | 2018-09-26 23:03:59 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-09-26 23:03:59 +0300 |
commit | a6537a1349de14f9fb457d7abb14147c7a0795b2 (patch) | |
tree | d1d0c8e765ec4c91d8aea6a48fc45c484f0ec802 /juick-server/src/main/java/com | |
parent | 213972ed2bbe724941b39a134ed6fb79b778a700 (diff) |
live reload for templates
Diffstat (limited to 'juick-server/src/main/java/com')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java b/juick-server/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java index f829a999..9f68032d 100644 --- a/juick-server/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java +++ b/juick-server/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java @@ -93,8 +93,16 @@ public class WwwAppConfiguration implements WebMvcConfigurer { @Bean public PebbleEngine pebbleEngine() { + boolean devToolsArePresent = false; + try { + Class.forName("org.springframework.boot.devtools.livereload.Connection"); + devToolsArePresent = true; + } catch (ClassNotFoundException e) { + // release mode + } return new PebbleEngine.Builder() .loader(this.templateLoader()) + .cacheActive(!devToolsArePresent) .extension(springExtension()) .extension(new FormatterExtension()) .strictVariables(true) |