use three-minifier

599K -> 381K
This commit is contained in:
yushijinhun 2020-01-31 08:43:46 +08:00
parent 92abd67c8a
commit 743adb97b8
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
3 changed files with 28 additions and 0 deletions

25
package-lock.json generated
View File

@ -174,6 +174,16 @@
} }
} }
}, },
"@yushijinhun/three-minifier-rollup": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/@yushijinhun/three-minifier-rollup/-/three-minifier-rollup-0.1.4.tgz",
"integrity": "sha512-tghDPR9O566LUgopJwCrtcDKBI2eS49cr2024ppW0qBmYQ+eCz8Zl/ljpe89leRlHK+XbuZVb0/4NEZ+c7gJlA==",
"dev": true,
"requires": {
"@rollup/plugin-node-resolve": "^7.0.0",
"magic-string": "^0.25.6"
}
},
"JSONStream": { "JSONStream": {
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
@ -1847,6 +1857,15 @@
"koa-static": "^5.0.0" "koa-static": "^5.0.0"
} }
}, },
"magic-string": {
"version": "0.25.6",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.6.tgz",
"integrity": "sha512-3a5LOMSGoCTH5rbqobC2HuDNRtE2glHZ8J7pK+QZYppyWA36yuNpsX994rIY2nCuyP7CZYy7lQq/X2jygiZ89g==",
"dev": true,
"requires": {
"sourcemap-codec": "^1.4.4"
}
},
"media-typer": { "media-typer": {
"version": "0.3.0", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@ -2539,6 +2558,12 @@
"source-map": "^0.6.0" "source-map": "^0.6.0"
} }
}, },
"sourcemap-codec": {
"version": "1.4.8",
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
"dev": true
},
"spdx-correct": { "spdx-correct": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",

View File

@ -46,6 +46,7 @@
"@rollup/plugin-typescript": "^2.1.0", "@rollup/plugin-typescript": "^2.1.0",
"@typescript-eslint/eslint-plugin": "^2.17.0", "@typescript-eslint/eslint-plugin": "^2.17.0",
"@typescript-eslint/parser": "^2.17.0", "@typescript-eslint/parser": "^2.17.0",
"@yushijinhun/three-minifier-rollup": "^0.1.4",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"local-web-server": "^3.0.7", "local-web-server": "^3.0.7",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",

View File

@ -1,6 +1,7 @@
import resolve from "@rollup/plugin-node-resolve"; import resolve from "@rollup/plugin-node-resolve";
import typescript from '@rollup/plugin-typescript'; import typescript from '@rollup/plugin-typescript';
import { terser } from "rollup-plugin-terser"; import { terser } from "rollup-plugin-terser";
import { threeMinifier } from "@yushijinhun/three-minifier-rollup";
export default { export default {
input: "src/skinview3d.ts", input: "src/skinview3d.ts",
@ -13,6 +14,7 @@ export default {
compact: true compact: true
}, },
plugins: [ plugins: [
threeMinifier(),
typescript(), typescript(),
resolve(), resolve(),
terser() terser()