From 7986373f192f43a2fb40bd9866f0a0cf6ce0917e Mon Sep 17 00:00:00 2001 From: bddjr Date: Wed, 22 Jan 2025 10:30:35 +0800 Subject: [PATCH] 1.4.1 upgrade dependencies --- README.md | 112 +++++++++++++++++++++++++--------------------- package-lock.json | 20 ++++----- package.json | 6 +-- src/index.ts | 2 +- 4 files changed, 74 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 3b4f5c2..f5b95ae 100644 --- a/README.md +++ b/README.md @@ -37,58 +37,66 @@ const router = createRouter({ ## Options -See [src/options.ts](src/options.ts) +Example: + +```ts +singleFileCompression({ + rename: 'example.html' +}), +``` + +More info see [src/options.ts](src/options.ts) ```ts export interface Options { - /** - * Rename index.html - */ - rename?: string - - /** - * https://github.com/terser/html-minifier-terser?tab=readme-ov-file#options-quick-reference - * @default defaultHtmlMinifierTerserOptions - */ - htmlMinifierTerser?: htmlMinifierOptions | boolean - - /** - * Try inline html used assets, if inlined or not used in JS. - * @default true - */ - tryInlineHtmlAssets?: boolean - - /** - * Remove inlined asset files. - * @default true - */ - removeInlinedAssetFiles?: boolean - - /** - * Try inline html icon, if icon is in public dir. - * @default true - */ - tryInlineHtmlPublicIcon?: boolean - - /** - * Remove inlined html icon files. - * @default true - */ - removeInlinedPublicIconFiles?: boolean - - /** - * Use Base128 to encode gzipped script. - * If false, use Base64. - * https://www.npmjs.com/package/base128-ascii - * @default true - */ - useBase128?: boolean - - /** - * Compress format. - * @default "deflate-raw" - */ - compressFormat?: compressFormat + /** + * Rename index.html + */ + rename?: string; + + /** + * https://github.com/terser/html-minifier-terser?tab=readme-ov-file#options-quick-reference + * @default defaultHtmlMinifierTerserOptions + */ + htmlMinifierTerser?: htmlMinifierOptions | boolean; + + /** + * Try inline html used assets, if inlined or not used in JS. + * @default true + */ + tryInlineHtmlAssets?: boolean; + + /** + * Remove inlined asset files. + * @default true + */ + removeInlinedAssetFiles?: boolean; + + /** + * Try inline html icon, if icon is in public dir. + * @default true + */ + tryInlineHtmlPublicIcon?: boolean; + + /** + * Remove inlined html icon files. + * @default true + */ + removeInlinedPublicIconFiles?: boolean; + + /** + * Use Base128 to encode gzipped script. + * If false, use Base64. + * https://www.npmjs.com/package/base128-ascii + * @default true + */ + useBase128?: boolean; + + /** + * Compress format. + * @default "deflate-raw" + */ + compressFormat?: compressFormat; } ``` @@ -97,11 +105,11 @@ export interface Options { https://bddjr.github.io/vite-plugin-singlefile-compression/ ``` -vite v6.0.7 building for production... +vite v6.0.11 building for production... ✓ 45 modules transformed. rendering chunks (1)... -vite-plugin-singlefile-compression 1.4.0 building... +vite-plugin-singlefile-compression 1.4.1 building... file:///D:/bddjr/Desktop/code/js/vite-plugin-singlefile-compression/test/dist/index.html 101.56 KiB -> 46.32 KiB @@ -109,7 +117,7 @@ vite-plugin-singlefile-compression 1.4.0 building... Finish. dist/index.html 47.42 kB -✓ built in 698ms +✓ built in 680ms ``` ![](effect.jpg) diff --git a/package-lock.json b/package-lock.json index f7098df..ca35326 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "vite-plugin-singlefile-compression", - "version": "1.4.0", + "version": "1.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vite-plugin-singlefile-compression", - "version": "1.4.0", + "version": "1.4.1", "license": "MIT", "dependencies": { "@types/html-minifier-terser": "^7.0.2", - "@types/node": "^22.9.3", + "@types/node": "^22.10.7", "base128-ascii": "^2.1.0", "esbuild": "^0.24.0", "html-minifier-terser": "^7.2.0", @@ -19,7 +19,7 @@ "picocolors": "^1.1.1", "rimraf": "^6.0.1", "typescript": "^5.7.2", - "vite": "^6.0.7" + "vite": "^6.0.11" } }, "node_modules/@esbuild/aix-ppc64": { @@ -757,9 +757,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.10.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.5.tgz", - "integrity": "sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==", + "version": "22.10.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.7.tgz", + "integrity": "sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==", "license": "MIT", "dependencies": { "undici-types": "~6.20.0" @@ -1526,9 +1526,9 @@ "license": "MIT" }, "node_modules/vite": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.9.tgz", - "integrity": "sha512-MSgUxHcaXLtnBPktkbUSoQUANApKYuxZ6DrbVENlIorbhL2dZydTLaZ01tjUoE3szeFzlFk9ANOKk0xurh4MKA==", + "version": "6.0.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.11.tgz", + "integrity": "sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg==", "license": "MIT", "dependencies": { "esbuild": "^0.24.2", diff --git a/package.json b/package.json index d4515fa..d54c4e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vite-plugin-singlefile-compression", - "version": "1.4.0", + "version": "1.4.1", "main": "dist/index.js", "typings": "dist/index.d.ts", "files": [ @@ -41,7 +41,7 @@ ], "dependencies": { "@types/html-minifier-terser": "^7.0.2", - "@types/node": "^22.9.3", + "@types/node": "^22.10.7", "base128-ascii": "^2.1.0", "esbuild": "^0.24.0", "html-minifier-terser": "^7.2.0", @@ -50,6 +50,6 @@ "picocolors": "^1.1.1", "rimraf": "^6.0.1", "typescript": "^5.7.2", - "vite": "^6.0.7" + "vite": "^6.0.11" } } diff --git a/src/index.ts b/src/index.ts index f66f985..b88ecd6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -60,7 +60,7 @@ function setConfig(config: UserConfig) { } async function generateBundle(bundle: OutputBundle, config: ResolvedConfig, options: innerOptions) { - console.log(pc.reset('') + pc.cyan('\n\nvite-plugin-singlefile-compression ' + version) + pc.green(' building...')) + console.log(pc.reset('\n\n') + pc.cyan('vite-plugin-singlefile-compression ' + version) + pc.green(' building...')) // rename if (options.rename