From 743adb97b852cd9e2a83f29cf7bde240adb22ea1 Mon Sep 17 00:00:00 2001 From: yushijinhun Date: Fri, 31 Jan 2020 08:43:46 +0800 Subject: [PATCH] use three-minifier 599K -> 381K --- package-lock.json | 25 +++++++++++++++++++++++++ package.json | 1 + rollup.config.js | 2 ++ 3 files changed, 28 insertions(+) diff --git a/package-lock.json b/package-lock.json index 6411563..2ceccd4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", @@ -1847,6 +1857,15 @@ "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": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -2539,6 +2558,12 @@ "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": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", diff --git a/package.json b/package.json index f26d470..df87476 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@rollup/plugin-typescript": "^2.1.0", "@typescript-eslint/eslint-plugin": "^2.17.0", "@typescript-eslint/parser": "^2.17.0", + "@yushijinhun/three-minifier-rollup": "^0.1.4", "eslint": "^6.8.0", "local-web-server": "^3.0.7", "npm-run-all": "^4.1.5", diff --git a/rollup.config.js b/rollup.config.js index 94cc147..31d2dd7 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,7 @@ import resolve from "@rollup/plugin-node-resolve"; import typescript from '@rollup/plugin-typescript'; import { terser } from "rollup-plugin-terser"; +import { threeMinifier } from "@yushijinhun/three-minifier-rollup"; export default { input: "src/skinview3d.ts", @@ -13,6 +14,7 @@ export default { compact: true }, plugins: [ + threeMinifier(), typescript(), resolve(), terser()