Minify json files and images

This commit is contained in:
Martin Prokoph
2024-08-25 12:52:37 +02:00
parent 8aab796530
commit 64d26e38b5
6 changed files with 12 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
import groovy.json.JsonSlurper
import groovy.json.JsonOutput
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
@@ -58,6 +61,14 @@ allprojects {
return changes.toString()
}
}
processResources {
// Minify json resources
doLast {
fileTree(dir: outputs.files.asPath, include: "**/*.json").each {
File file -> file.text = JsonOutput.toJson(new JsonSlurper().parse(file))
}
}
}
java {
withSourcesJar()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 114 B

View File

@@ -41,7 +41,7 @@
},
"depends": {
"fabric-resource-loader-v0": "*",
"minecraft": ">=1.20.4"
"minecraft": ">=1.21"
},
"mixins": [