diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0e12312..a77f56c 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -14,4 +14,4 @@ jobs: with: java-version: 1.8 - name: Build with Gradle - run: ./gradlew build + run: ./gradlew minifyJs diff --git a/build.gradle b/build.gradle index 8a0a9b4..3b9ab7c 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ buildscript { ext.kotlin_version = '1.3.50' repositories { + jcenter() maven { url "http://nexus.astraeus.nl/nexus/content/groups/public" } @@ -12,9 +13,11 @@ buildscript { } dependencies { 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-dce-js' @@ -55,3 +58,25 @@ runDceKotlinJs.doLast { 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" + } +} diff --git a/web/index.html b/web/index.html index 1e997e2..b096035 100644 --- a/web/index.html +++ b/web/index.html @@ -12,9 +12,6 @@
Compare other javascript MVC* frameworks with TodoMVC
- - - - +