vite-plugin-singlefile-compression 2.0.13 → 2.0.14
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 +7 -6
- package/dist/index.js +14 -6
- package/package.json +22 -17
- package/browser.min.js +0 -1
package/README.md
CHANGED
|
@@ -118,19 +118,20 @@ export interface Options {
|
|
|
118
118
|
https://bddjr.github.io/vite-plugin-singlefile-compression/
|
|
119
119
|
|
|
120
120
|
```
|
|
121
|
-
vite
|
|
122
|
-
✓
|
|
121
|
+
vite v8.0.0 building client environment for production...
|
|
122
|
+
✓ 41 modules transformed.
|
|
123
123
|
rendering chunks (1)...
|
|
124
124
|
|
|
125
|
-
vite-plugin-singlefile-compression 2.0.
|
|
125
|
+
vite-plugin-singlefile-compression 2.0.14 building...
|
|
126
126
|
|
|
127
127
|
file:///D:/code/js/vite-plugin-singlefile-compression/test/dist/index.html
|
|
128
|
-
|
|
128
|
+
106.506 kB -> 47.487 kB
|
|
129
129
|
|
|
130
130
|
Finish.
|
|
131
131
|
|
|
132
|
-
dist/index.html 48
|
|
133
|
-
|
|
132
|
+
dist/index.html 47.48 kB
|
|
133
|
+
|
|
134
|
+
✓ built in 296ms
|
|
134
135
|
```
|
|
135
136
|
|
|
136
137
|

|
package/dist/index.js
CHANGED
|
@@ -23,17 +23,25 @@ export function singleFileCompression(opt) {
|
|
|
23
23
|
export default singleFileCompression;
|
|
24
24
|
function setConfig(config, env) {
|
|
25
25
|
config.base ??= './';
|
|
26
|
-
const build =
|
|
26
|
+
const build = config.build ??= {};
|
|
27
27
|
build.cssCodeSplit ??= false;
|
|
28
28
|
build.assetsInlineLimit ??= () => true;
|
|
29
29
|
build.chunkSizeWarningLimit ??= Number.MAX_SAFE_INTEGER;
|
|
30
30
|
build.modulePreload ??= { polyfill: false };
|
|
31
31
|
build.reportCompressedSize ??= false;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
if (this.meta.rolldownVersion) {
|
|
33
|
+
// Vite 8
|
|
34
|
+
const rolldownOptions = build.rolldownOptions ?? build.rollupOptions ?? (build.rolldownOptions = {});
|
|
35
|
+
for (const output of [rolldownOptions.output ??= {}].flat(1)) {
|
|
36
|
+
output.codeSplitting ??= false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Vite oldest
|
|
41
|
+
const rollupOptions = (build.rollupOptions ??= {});
|
|
42
|
+
for (const output of [rollupOptions.output ??= {}].flat(1)) {
|
|
43
|
+
output.inlineDynamicImports ??= true;
|
|
44
|
+
}
|
|
37
45
|
}
|
|
38
46
|
}
|
|
39
47
|
async function generateBundle(bundle, config, options) {
|
package/package.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-singlefile-compression",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"author": "bddjr",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Compress all assets and embeds them into dist/index.html, making it convenient to share as a single HTML file.",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
-
"browser": "./browser.min.js",
|
|
10
9
|
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
"./browser.min.js"
|
|
10
|
+
"dist"
|
|
13
11
|
],
|
|
14
12
|
"type": "module",
|
|
15
13
|
"scripts": {
|
|
@@ -40,25 +38,32 @@
|
|
|
40
38
|
"js",
|
|
41
39
|
"javascript",
|
|
42
40
|
"css",
|
|
43
|
-
"class"
|
|
41
|
+
"class",
|
|
42
|
+
"rolldown",
|
|
43
|
+
"rolldown-vite",
|
|
44
|
+
"rollup",
|
|
45
|
+
"vite-plugin-singlefile",
|
|
46
|
+
"vite-plugin-compression",
|
|
47
|
+
"vite-plugin-compression2"
|
|
44
48
|
],
|
|
45
49
|
"dependencies": {
|
|
46
50
|
"@types/html-minifier-terser": ">=7.0.2",
|
|
47
|
-
"base128-ascii": ">=2.1.
|
|
51
|
+
"base128-ascii": ">=2.1.11",
|
|
48
52
|
"html-minifier-terser": ">=7.2.0",
|
|
49
|
-
"jsdom": ">=
|
|
50
|
-
"mime": ">=4.0
|
|
53
|
+
"jsdom": ">=28.1.0",
|
|
54
|
+
"mime": ">=4.1.0",
|
|
51
55
|
"mini-svg-data-uri": ">=1.4.4",
|
|
52
56
|
"picocolors": ">=1.1.1"
|
|
53
57
|
},
|
|
54
58
|
"devDependencies": {
|
|
55
|
-
"@types/jsdom": ">=
|
|
56
|
-
"@types/node": ">=
|
|
57
|
-
"es-check": "
|
|
58
|
-
"esbuild": ">=0.
|
|
59
|
-
"rimraf": ">=6.
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
59
|
+
"@types/jsdom": ">=28.0.0",
|
|
60
|
+
"@types/node": ">=25.5.0",
|
|
61
|
+
"es-check": ">=9.6.2",
|
|
62
|
+
"esbuild": ">=0.27.4",
|
|
63
|
+
"rimraf": ">=6.1.3",
|
|
64
|
+
"rolldown": ">=1.0.0-rc.9",
|
|
65
|
+
"rollup": ">=4.59.0",
|
|
66
|
+
"typescript": ">=5.9.3",
|
|
67
|
+
"vite": ">=8.0.0"
|
|
63
68
|
}
|
|
64
|
-
}
|
|
69
|
+
}
|
package/browser.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
throw Error("This npm package does not support running in the web browser.")
|