vite-plugin-singlefile-compression 2.0.2 → 2.0.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 (2) hide show
  1. package/dist/index.js +6 -15
  2. package/package.json +9 -7
package/dist/index.js CHANGED
@@ -27,25 +27,14 @@ function setConfig(config) {
27
27
  // config.build.assetsDir = 'assets'
28
28
  config.build.cssCodeSplit = false;
29
29
  config.build.assetsInlineLimit ??= () => true;
30
- config.build.chunkSizeWarningLimit ??= Infinity;
30
+ config.build.chunkSizeWarningLimit ??= Number.MAX_SAFE_INTEGER;
31
31
  config.build.modulePreload ??= { polyfill: false };
32
- config.build.target ??= 'esnext';
32
+ // config.build.target ??= 'esnext'
33
33
  config.build.reportCompressedSize ??= false;
34
34
  config.build.rollupOptions ??= {};
35
35
  config.build.rollupOptions.output ??= {};
36
- function setRollupOutput(output) {
36
+ for (const output of [config.build.rollupOptions.output].flat(1)) {
37
37
  output.inlineDynamicImports = true;
38
- // delete output.assetFileNames
39
- // delete output.chunkFileNames
40
- // delete output.entryFileNames
41
- }
42
- if (Array.isArray(config.build.rollupOptions.output)) {
43
- for (const output of config.build.rollupOptions.output) {
44
- setRollupOutput(output);
45
- }
46
- }
47
- else {
48
- setRollupOutput(config.build.rollupOptions.output);
49
38
  }
50
39
  }
51
40
  async function generateBundle(bundle, config, options) {
@@ -137,7 +126,9 @@ async function generateBundle(bundle, config, options) {
137
126
  thisDel.add(bundleName);
138
127
  oldSize += a.source.length;
139
128
  if (!Object.hasOwn(globalAssetsDataURL, name))
140
- globalAssetsDataURL[name] = bufferToDataURL(name, Buffer.from(a.source));
129
+ globalAssetsDataURL[name] = bufferToDataURL(name, Buffer.from(
130
+ //@ts-ignore
131
+ a.source));
141
132
  assetsDataURL[name] = globalAssetsDataURL[name];
142
133
  }
143
134
  element.src = `data:${name}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-singlefile-compression",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -31,9 +31,11 @@
31
31
  "gzip",
32
32
  "inline",
33
33
  "frontend",
34
+ "front-end",
34
35
  "js",
35
36
  "javascript",
36
- "css"
37
+ "css",
38
+ "class"
37
39
  ],
38
40
  "dependencies": {
39
41
  "base128-ascii": ">=2.1.0",
@@ -42,13 +44,13 @@
42
44
  "mime": ">=4.0.4",
43
45
  "mini-svg-data-uri": ">=1.4.4",
44
46
  "picocolors": ">=1.1.1",
45
- "rimraf": ">=6.0.1",
46
- "vite": ">=6.0.13",
47
- "@types/html-minifier-terser": ">=7.0.2",
48
- "@types/node": ">=22.10.7",
49
- "@types/jsdom": ">=21.1.7"
47
+ "@types/html-minifier-terser": ">=7.0.2"
50
48
  },
51
49
  "devDependencies": {
50
+ "vite": ">=6.2.5",
51
+ "rimraf": ">=6.0.1",
52
+ "@types/jsdom": ">=21.1.7",
53
+ "@types/node": ">=22.10.7",
52
54
  "esbuild": ">=0.25.0",
53
55
  "typescript": ">=5.7.2"
54
56
  }