Update minify

This commit is contained in:
2019-11-15 19:26:50 +01:00
parent 8f7b03b5b8
commit 88d2a8bff1
4 changed files with 47 additions and 5 deletions

View File

@@ -14,4 +14,4 @@ jobs:
with: with:
java-version: 1.8 java-version: 1.8
- name: Build with Gradle - name: Build with Gradle
run: ./gradlew build run: ./gradlew minifyJs

View File

@@ -2,6 +2,7 @@ buildscript {
ext.kotlin_version = '1.3.50' ext.kotlin_version = '1.3.50'
repositories { repositories {
jcenter()
maven { maven {
url "http://nexus.astraeus.nl/nexus/content/groups/public" url "http://nexus.astraeus.nl/nexus/content/groups/public"
} }
@@ -12,9 +13,11 @@ buildscript {
} }
dependencies { dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.eriwen:gradle-js-plugin:1.12.1"
} }
} }
apply plugin: "com.eriwen.gradle.js"
apply plugin: 'kotlin-platform-js' apply plugin: 'kotlin-platform-js'
apply plugin: 'kotlin-dce-js' apply plugin: 'kotlin-dce-js'
@@ -55,3 +58,25 @@ runDceKotlinJs.doLast {
into("web/js/generated") into("web/js/generated")
} }
} }
// Create new CombineJsTasks if you have multiple sets of JS files
combineJs {
dependsOn runDceKotlinJs
source = [
"${projectDir}/web/js/generated/kotlin.js",
"${projectDir}/web/js/generated/kotlinx-html-js.js",
"${projectDir}/web/js/generated/komp.js",
"${projectDir}/web/js/generated/komp-todo.js"
]
dest = file("${projectDir}/web/js/generated/todo.all.js")
}
minifyJs {
dependsOn combineJs
source = "${projectDir}/web/js/generated/todo.all.js"
dest = file("${projectDir}/web/js/generated/todo.all.min.js")
closure {
warningLevel = 'QUIET'
compilerOptions.languageIn = "ECMASCRIPT5"
}
}

View File

@@ -12,9 +12,6 @@
<p>Compare other javascript MVC* frameworks with <a href="http://todomvc.com">TodoMVC</a></p> <p>Compare other javascript MVC* frameworks with <a href="http://todomvc.com">TodoMVC</a></p>
</footer> </footer>
<script src="js/generated/kotlin.js" ></script> <script src="js/generated/todo.all.min.js" ></script>
<script src="js/generated/kotlinx-html-js.js" ></script>
<script src="js/generated/komp.js" ></script>
<script src="js/generated/komp-todo.js" ></script>
</body> </body>
</html> </html>

20
web/index_dev.html Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Komp-Todo</title>
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<footer class="info">
<p>Double-click to edit a todo</p>
<p>Compare other javascript MVC* frameworks with <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
<script src="js/generated/kotlin.js" ></script>
<script src="js/generated/kotlinx-html-js.js" ></script>
<script src="js/generated/komp.js" ></script>
<script src="js/generated/komp-todo.js" ></script>
</body>
</html>