vite-plugin-singlefile-compression 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/index.d.ts +1 -0
- package/dist/template-assets.js +1 -1
- package/dist/template-base128.js +1 -1
- package/dist/template.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -86,6 +86,7 @@ export interface Options {
|
|
|
86
86
|
/**
|
|
87
87
|
* Use Base128 to encode gzipped script.
|
|
88
88
|
* If false, use Base64.
|
|
89
|
+
* https://www.npmjs.com/package/base128-ascii
|
|
89
90
|
* @default true
|
|
90
91
|
*/
|
|
91
92
|
useBase128?: boolean
|
|
@@ -101,15 +102,15 @@ vite v6.0.6 building for production...
|
|
|
101
102
|
✓ 45 modules transformed.
|
|
102
103
|
rendering chunks (1)...
|
|
103
104
|
|
|
104
|
-
vite-plugin-singlefile-compression 1.2.
|
|
105
|
+
vite-plugin-singlefile-compression 1.2.4 building...
|
|
105
106
|
|
|
106
107
|
file:///D:/bddjr/Desktop/code/js/vite-plugin-singlefile-compression/test/dist/index.html
|
|
107
|
-
101.02 KiB -> 46.
|
|
108
|
+
101.02 KiB -> 46.52 KiB
|
|
108
109
|
|
|
109
110
|
Finish.
|
|
110
111
|
|
|
111
|
-
dist/index.html 47.
|
|
112
|
-
✓ built in
|
|
112
|
+
dist/index.html 47.64 kB
|
|
113
|
+
✓ built in 690ms
|
|
113
114
|
```
|
|
114
115
|
|
|
115
116
|
## Clone
|
package/dist/index.d.ts
CHANGED
package/dist/template-assets.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{
|
|
1
|
+
{let e={"":""};for(let o in e){for(let r of document.querySelectorAll(`[src="data:${o}"]`))r.src=e[o];for(let r of document.querySelectorAll(`[href="data:${o}"]`))r.href=e[o]}}
|
package/dist/template-base128.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function s(e){let l=0,o=0,n,r=()=>n=e.charCodeAt(l++),t=new Uint8Array(Math.floor(e.length/8*7));for(;l<e.length;)t[o++]=r()<<1|r()>>6,t[o++]=n<<2|r()>>5,t[o++]=n<<3|r()>>4,t[o++]=n<<4|r()>>3,t[o++]=n<<5|r()>>2,t[o++]=n<<6|r()>>1,t[o++]=n<<7|r();return t}new Response(new ReadableStream({start(e){e.enqueue(s("<script>")),e.close()}}).pipeThrough(new DecompressionStream("gzip")),{headers:{"Content-Type":"text/javascript"}}).blob().then(e=>import(e=URL.createObjectURL(e)).finally(()=>URL.revokeObjectURL(e)))
|
package/dist/template.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
fetch("data:application/gzip;base64,{<script>}").then(
|
|
1
|
+
fetch("data:application/gzip;base64,{<script>}").then(e=>new Response(e.body.pipeThrough(new DecompressionStream("gzip")),{headers:{"Content-Type":"text/javascript"}}).blob()).then(e=>import(e=URL.createObjectURL(e)).finally(()=>URL.revokeObjectURL(e)))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-singlefile-compression",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@types/html-minifier-terser": "^7.0.2",
|
|
44
44
|
"@types/node": "^22.9.3",
|
|
45
|
-
"base128-ascii": "^2.0.
|
|
45
|
+
"base128-ascii": "^2.0.1",
|
|
46
46
|
"esbuild": "^0.24.0",
|
|
47
47
|
"html-minifier-terser": "^7.2.0",
|
|
48
48
|
"mime": "^4.0.4",
|