vite-plugin-singlefile-compression 2.2.3 → 2.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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/dist/index.js +3 -3
  3. package/package.json +22 -15
package/README.md CHANGED
@@ -152,11 +152,11 @@ type: `boolean`
152
152
  Preview: https://bddjr.github.io/vite-plugin-singlefile-compression/
153
153
 
154
154
  ```
155
- vite v8.0.5 building client environment for production...
155
+ vite v8.0.8 building client environment for production...
156
156
  ✓ 42 modules transformed.
157
157
  rendering chunks (1)...
158
158
 
159
- vite-plugin-singlefile-compression 2.2.3 deflate-raw base128-ascii
159
+ vite-plugin-singlefile-compression 2.2.4 deflate-raw base128-ascii
160
160
 
161
161
  file:///D:/code/js/vite-plugin-singlefile-compression/test/dist/index.html
162
162
  122.750 kB -> 50.221 kB
@@ -166,7 +166,7 @@ Finish.
166
166
  computing gzip size...
167
167
  dist/index.html 50.22 kB │ gzip: 43.79 kB
168
168
 
169
- ✓ built in 275ms
169
+ ✓ built in 282ms
170
170
  ```
171
171
 
172
172
  ## Clone
package/dist/index.js CHANGED
@@ -7,9 +7,9 @@ import { pathToFileURL } from "url";
7
7
  import base128 from "base128-ascii";
8
8
  import zlib from "zlib";
9
9
  import svgToTinyDataUri from "mini-svg-data-uri";
10
- import mime from "mime";
10
+ import { lookup } from "mrmime";
11
11
  //#region package.json
12
- var version = "2.2.3";
12
+ var version = "2.2.4";
13
13
  //#endregion
14
14
  //#region src/compress.ts
15
15
  const compressors = {
@@ -107,7 +107,7 @@ const template = {
107
107
  //#endregion
108
108
  //#region src/dataurl.ts
109
109
  function bufferToDataURL(name, b) {
110
- return /\.svg$/i.test(name) ? svgToTinyDataUri(b.toString()) : `data:${mime.getType(name)};base64,${b.toString("base64")}`;
110
+ return /\.svg$/i.test(name) ? svgToTinyDataUri(b.toString()) : `data:${lookup(name)};base64,${b.toString("base64")}`;
111
111
  }
112
112
  //#endregion
113
113
  //#region src/kB.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-singlefile-compression",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
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.",
@@ -78,24 +78,31 @@
78
78
  "vite-plugin-compression2",
79
79
  "html-minifier-terser"
80
80
  ],
81
+ "peerDependencies": {
82
+ "@types/node": "*",
83
+ "vite": ">=3.0.0"
84
+ },
85
+ "peerDependenciesMeta": {
86
+ "@types/node": {
87
+ "optional": true
88
+ }
89
+ },
81
90
  "dependencies": {
82
91
  "@types/html-minifier-terser": ">=7.0.2",
83
- "@types/node": "*",
84
- "base128-ascii": ">=2.1.11",
92
+ "base128-ascii": "^2.1.12",
85
93
  "html-minifier-terser": ">=7.2.0",
86
- "jsdom": ">=28.1.0",
87
- "mime": ">=4.1.0",
94
+ "jsdom": ">=29.0.2",
88
95
  "mini-svg-data-uri": ">=1.4.4",
89
- "picocolors": ">=1.1.1",
90
- "vite": ">=3.0.0"
96
+ "mrmime": ">=2.0.1",
97
+ "picocolors": ">=1.1.1"
91
98
  },
92
99
  "devDependencies": {
93
- "@types/jsdom": ">=28.0.0",
94
- "@types/node": "^22.19.15",
95
- "rolldown": ">=1.0.0-rc.9",
96
- "rolldown-plugin-dts": "^0.22.5",
97
- "terser": "^5.46.1",
98
- "typescript": ">=5.9.3",
99
- "vite": ">=8.0.0"
100
+ "@types/jsdom": ">=28.0.1",
101
+ "@types/node": "^22.19.17",
102
+ "rolldown": ">=1.0.0-rc.15",
103
+ "rolldown-plugin-dts": ">=0.22.5",
104
+ "terser": ">=5.46.1",
105
+ "typescript": ">=6.0.2",
106
+ "vite": ">=8.0.8"
100
107
  }
101
- }
108
+ }