@uni_toolkit/unplugin-json-optimization 0.0.15 → 0.0.16

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.
@@ -30,7 +30,8 @@ var unpluginFactory = (options = {
30
30
  }
31
31
  },
32
32
  generateBundle(_, bundle) {
33
- for (const [fileName, chunk] of Object.entries(bundle)) {
33
+ const bundleEntries = Object.entries(bundle);
34
+ for (const [fileName, chunk] of bundleEntries) {
34
35
  if (chunk.type !== "chunk" || !chunk.moduleIds || !chunk.moduleIds.length || fileName.includes("/")) {
35
36
  continue;
36
37
  }
@@ -43,7 +44,7 @@ var unpluginFactory = (options = {
43
44
  }
44
45
  }
45
46
  const keys = Array.from(pathMap.keys());
46
- for (const [fileName, chunk] of Object.entries(bundle)) {
47
+ for (const [fileName, chunk] of bundleEntries) {
47
48
  if (chunk.type !== "chunk") {
48
49
  continue;
49
50
  }
package/dist/index.cjs CHANGED
@@ -66,7 +66,8 @@ var unpluginFactory = (options = {
66
66
  }
67
67
  },
68
68
  generateBundle(_, bundle) {
69
- for (const [fileName, chunk] of Object.entries(bundle)) {
69
+ const bundleEntries = Object.entries(bundle);
70
+ for (const [fileName, chunk] of bundleEntries) {
70
71
  if (chunk.type !== "chunk" || !chunk.moduleIds || !chunk.moduleIds.length || fileName.includes("/")) {
71
72
  continue;
72
73
  }
@@ -79,7 +80,7 @@ var unpluginFactory = (options = {
79
80
  }
80
81
  }
81
82
  const keys = Array.from(pathMap.keys());
82
- for (const [fileName, chunk] of Object.entries(bundle)) {
83
+ for (const [fileName, chunk] of bundleEntries) {
83
84
  if (chunk.type !== "chunk") {
84
85
  continue;
85
86
  }
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  src_default,
3
3
  unplugin,
4
4
  unpluginFactory
5
- } from "./chunk-ZDVJORCZ.js";
5
+ } from "./chunk-A5XPZGFI.js";
6
6
  export {
7
7
  src_default as default,
8
8
  unplugin,
package/dist/vite.cjs CHANGED
@@ -67,7 +67,8 @@ var unpluginFactory = (options = {
67
67
  }
68
68
  },
69
69
  generateBundle(_, bundle) {
70
- for (const [fileName, chunk] of Object.entries(bundle)) {
70
+ const bundleEntries = Object.entries(bundle);
71
+ for (const [fileName, chunk] of bundleEntries) {
71
72
  if (chunk.type !== "chunk" || !chunk.moduleIds || !chunk.moduleIds.length || fileName.includes("/")) {
72
73
  continue;
73
74
  }
@@ -80,7 +81,7 @@ var unpluginFactory = (options = {
80
81
  }
81
82
  }
82
83
  const keys = Array.from(pathMap.keys());
83
- for (const [fileName, chunk] of Object.entries(bundle)) {
84
+ for (const [fileName, chunk] of bundleEntries) {
84
85
  if (chunk.type !== "chunk") {
85
86
  continue;
86
87
  }
package/dist/vite.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-ZDVJORCZ.js";
3
+ } from "./chunk-A5XPZGFI.js";
4
4
 
5
5
  // src/vite.ts
6
6
  import { createVitePlugin } from "unplugin";
package/dist/webpack.cjs CHANGED
@@ -67,7 +67,8 @@ var unpluginFactory = (options = {
67
67
  }
68
68
  },
69
69
  generateBundle(_, bundle) {
70
- for (const [fileName, chunk] of Object.entries(bundle)) {
70
+ const bundleEntries = Object.entries(bundle);
71
+ for (const [fileName, chunk] of bundleEntries) {
71
72
  if (chunk.type !== "chunk" || !chunk.moduleIds || !chunk.moduleIds.length || fileName.includes("/")) {
72
73
  continue;
73
74
  }
@@ -80,7 +81,7 @@ var unpluginFactory = (options = {
80
81
  }
81
82
  }
82
83
  const keys = Array.from(pathMap.keys());
83
- for (const [fileName, chunk] of Object.entries(bundle)) {
84
+ for (const [fileName, chunk] of bundleEntries) {
84
85
  if (chunk.type !== "chunk") {
85
86
  continue;
86
87
  }
package/dist/webpack.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-ZDVJORCZ.js";
3
+ } from "./chunk-A5XPZGFI.js";
4
4
 
5
5
  // src/webpack.ts
6
6
  import { createWebpackPlugin } from "unplugin";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uni_toolkit/unplugin-json-optimization",
3
3
  "type": "module",
4
- "version": "0.0.15",
4
+ "version": "0.0.16",
5
5
  "description": "A plugin to optimize json files generation",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/uni-toolkit/uni-toolkit/tree/main/packages/unplugin-json-optimization",