Commit 0538fac2 authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

transpile/minify javascript

parent c141626f
Pipeline #138565 passed with stages
in 9 minutes and 43 seconds
......@@ -2,6 +2,7 @@ plugins {
id 'org.springframework.boot' version '2.3.0.RELEASE'
id 'com.github.node-gradle.node' version '2.2.4'
id 'io.miret.etienne.sass' version '1.1.1'
id "com.leobia.gradle.jsgradlecompiler" version "0.3.0"
}
apply plugin: 'java'
......@@ -60,6 +61,7 @@ node {
// npm install should be run before processResources
processResources.dependsOn npmInstall
processResources.dependsOn compileSass
processResources.dependsOn compileJs
// copy static files to web application
processResources {
......@@ -81,6 +83,19 @@ processResources {
from ("${buildDir}/sass/") {
into 'static/css'
}
from ("${buildDir}/js/") {
into 'static/js'
}
}
jsOptions {
inputPath = file("./src/main/resources/static/js/")
outputPath = file("${buildDir}/js/")
compilationLevel = "SIMPLE_OPTIMIZATIONS"
jsVersionIn = 'ECMASCRIPT_2020'
jsVersionOut = 'ECMASCRIPT5'
combineAllFiles = false
keepSameName = false
}
test {
......
......@@ -108,6 +108,6 @@
</form>
<script src="/js/advanced-search.js"></script>
<script src="/js/advanced-search.min.js"></script>
<%@ include file="base/foot.jsp" %>
\ No newline at end of file
<%@ include file="base/foot.jsp" %>
......@@ -41,7 +41,7 @@
</footer>
<script src="/js/jquery.min.js"></script>
<script src="/js/theme.js"></script>
<script src="/js/theme.min.js"></script>
</div>
</body>
......
......@@ -6,7 +6,7 @@
<%@ include file="base/head.jsp" %>
<script type="text/javascript" src="/js/basket.js"></script>
<script type="text/javascript" src="/js/basket.min.js"></script>
<span hidden="true" id="basketItemString" data-value="${basketItemString}"></span>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment