vite-plugin-singlefile-compression 1.4.0 → 1.4.1
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 +60 -52
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -37,58 +37,66 @@ const router = createRouter({
|
|
|
37
37
|
|
|
38
38
|
## Options
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
Example:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
singleFileCompression({
|
|
44
|
+
rename: 'example.html'
|
|
45
|
+
}),
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
More info see [src/options.ts](src/options.ts)
|
|
41
49
|
|
|
42
50
|
```ts
|
|
43
51
|
export interface Options {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Rename index.html
|
|
54
|
+
*/
|
|
55
|
+
rename?: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* https://github.com/terser/html-minifier-terser?tab=readme-ov-file#options-quick-reference
|
|
59
|
+
* @default defaultHtmlMinifierTerserOptions
|
|
60
|
+
*/
|
|
61
|
+
htmlMinifierTerser?: htmlMinifierOptions | boolean;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Try inline html used assets, if inlined or not used in JS.
|
|
65
|
+
* @default true
|
|
66
|
+
*/
|
|
67
|
+
tryInlineHtmlAssets?: boolean;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Remove inlined asset files.
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
removeInlinedAssetFiles?: boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Try inline html icon, if icon is in public dir.
|
|
77
|
+
* @default true
|
|
78
|
+
*/
|
|
79
|
+
tryInlineHtmlPublicIcon?: boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Remove inlined html icon files.
|
|
83
|
+
* @default true
|
|
84
|
+
*/
|
|
85
|
+
removeInlinedPublicIconFiles?: boolean;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Use Base128 to encode gzipped script.
|
|
89
|
+
* If false, use Base64.
|
|
90
|
+
* https://www.npmjs.com/package/base128-ascii
|
|
91
|
+
* @default true
|
|
92
|
+
*/
|
|
93
|
+
useBase128?: boolean;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Compress format.
|
|
97
|
+
* @default "deflate-raw"
|
|
98
|
+
*/
|
|
99
|
+
compressFormat?: compressFormat;
|
|
92
100
|
}
|
|
93
101
|
```
|
|
94
102
|
|
|
@@ -97,11 +105,11 @@ export interface Options {
|
|
|
97
105
|
https://bddjr.github.io/vite-plugin-singlefile-compression/
|
|
98
106
|
|
|
99
107
|
```
|
|
100
|
-
vite v6.0.
|
|
108
|
+
vite v6.0.11 building for production...
|
|
101
109
|
✓ 45 modules transformed.
|
|
102
110
|
rendering chunks (1)...
|
|
103
111
|
|
|
104
|
-
vite-plugin-singlefile-compression 1.4.
|
|
112
|
+
vite-plugin-singlefile-compression 1.4.1 building...
|
|
105
113
|
|
|
106
114
|
file:///D:/bddjr/Desktop/code/js/vite-plugin-singlefile-compression/test/dist/index.html
|
|
107
115
|
101.56 KiB -> 46.32 KiB
|
|
@@ -109,7 +117,7 @@ vite-plugin-singlefile-compression 1.4.0 building...
|
|
|
109
117
|
Finish.
|
|
110
118
|
|
|
111
119
|
dist/index.html 47.42 kB
|
|
112
|
-
✓ built in
|
|
120
|
+
✓ built in 680ms
|
|
113
121
|
```
|
|
114
122
|
|
|
115
123
|

|
package/dist/index.js
CHANGED
|
@@ -48,7 +48,7 @@ function setConfig(config) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
async function generateBundle(bundle, config, options) {
|
|
51
|
-
console.log(pc.reset('') + pc.cyan('
|
|
51
|
+
console.log(pc.reset('\n\n') + pc.cyan('vite-plugin-singlefile-compression ' + version) + pc.green(' building...'));
|
|
52
52
|
// rename
|
|
53
53
|
if (options.rename
|
|
54
54
|
&& options.rename !== "index.html"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-singlefile-compression",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@types/html-minifier-terser": "^7.0.2",
|
|
44
|
-
"@types/node": "^22.
|
|
44
|
+
"@types/node": "^22.10.7",
|
|
45
45
|
"base128-ascii": "^2.1.0",
|
|
46
46
|
"esbuild": "^0.24.0",
|
|
47
47
|
"html-minifier-terser": "^7.2.0",
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
"picocolors": "^1.1.1",
|
|
51
51
|
"rimraf": "^6.0.1",
|
|
52
52
|
"typescript": "^5.7.2",
|
|
53
|
-
"vite": "^6.0.
|
|
53
|
+
"vite": "^6.0.11"
|
|
54
54
|
}
|
|
55
55
|
}
|