@uni_toolkit/unplugin-json-optimization 0.0.15 → 0.0.17-alpha.1775970596430
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/dist/{chunk-ZDVJORCZ.js → chunk-JXHP6A5L.js} +5 -4
- package/dist/index.cjs +5 -4
- package/dist/index.js +1 -1
- package/dist/vite.cjs +5 -4
- package/dist/vite.js +1 -1
- package/dist/webpack.cjs +5 -4
- package/dist/webpack.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { createUnplugin } from "unplugin";
|
|
3
|
-
import { createFilter } from "@rollup/pluginutils";
|
|
4
2
|
import path from "path";
|
|
3
|
+
import { createFilter } from "@rollup/pluginutils";
|
|
4
|
+
import { createUnplugin } from "unplugin";
|
|
5
5
|
function replaceRequirePaths(code, pathMapper) {
|
|
6
6
|
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (match, quote, path2) => {
|
|
7
7
|
const newPath = pathMapper(path2);
|
|
@@ -30,7 +30,8 @@ var unpluginFactory = (options = {
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
generateBundle(_, bundle) {
|
|
33
|
-
|
|
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
|
|
47
|
+
for (const [fileName, chunk] of bundleEntries) {
|
|
47
48
|
if (chunk.type !== "chunk") {
|
|
48
49
|
continue;
|
|
49
50
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -35,9 +35,9 @@ __export(src_exports, {
|
|
|
35
35
|
unpluginFactory: () => unpluginFactory
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(src_exports);
|
|
38
|
-
var import_unplugin = require("unplugin");
|
|
39
|
-
var import_pluginutils = require("@rollup/pluginutils");
|
|
40
38
|
var import_node_path = __toESM(require("path"), 1);
|
|
39
|
+
var import_pluginutils = require("@rollup/pluginutils");
|
|
40
|
+
var import_unplugin = require("unplugin");
|
|
41
41
|
function replaceRequirePaths(code, pathMapper) {
|
|
42
42
|
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (match, quote, path2) => {
|
|
43
43
|
const newPath = pathMapper(path2);
|
|
@@ -66,7 +66,8 @@ var unpluginFactory = (options = {
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
generateBundle(_, bundle) {
|
|
69
|
-
|
|
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
|
|
83
|
+
for (const [fileName, chunk] of bundleEntries) {
|
|
83
84
|
if (chunk.type !== "chunk") {
|
|
84
85
|
continue;
|
|
85
86
|
}
|
package/dist/index.js
CHANGED
package/dist/vite.cjs
CHANGED
|
@@ -36,9 +36,9 @@ module.exports = __toCommonJS(vite_exports);
|
|
|
36
36
|
var import_unplugin2 = require("unplugin");
|
|
37
37
|
|
|
38
38
|
// src/index.ts
|
|
39
|
-
var import_unplugin = require("unplugin");
|
|
40
|
-
var import_pluginutils = require("@rollup/pluginutils");
|
|
41
39
|
var import_node_path = __toESM(require("path"), 1);
|
|
40
|
+
var import_pluginutils = require("@rollup/pluginutils");
|
|
41
|
+
var import_unplugin = require("unplugin");
|
|
42
42
|
function replaceRequirePaths(code, pathMapper) {
|
|
43
43
|
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (match, quote, path2) => {
|
|
44
44
|
const newPath = pathMapper(path2);
|
|
@@ -67,7 +67,8 @@ var unpluginFactory = (options = {
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
generateBundle(_, bundle) {
|
|
70
|
-
|
|
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
|
|
84
|
+
for (const [fileName, chunk] of bundleEntries) {
|
|
84
85
|
if (chunk.type !== "chunk") {
|
|
85
86
|
continue;
|
|
86
87
|
}
|
package/dist/vite.js
CHANGED
package/dist/webpack.cjs
CHANGED
|
@@ -36,9 +36,9 @@ module.exports = __toCommonJS(webpack_exports);
|
|
|
36
36
|
var import_unplugin2 = require("unplugin");
|
|
37
37
|
|
|
38
38
|
// src/index.ts
|
|
39
|
-
var import_unplugin = require("unplugin");
|
|
40
|
-
var import_pluginutils = require("@rollup/pluginutils");
|
|
41
39
|
var import_node_path = __toESM(require("path"), 1);
|
|
40
|
+
var import_pluginutils = require("@rollup/pluginutils");
|
|
41
|
+
var import_unplugin = require("unplugin");
|
|
42
42
|
function replaceRequirePaths(code, pathMapper) {
|
|
43
43
|
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (match, quote, path2) => {
|
|
44
44
|
const newPath = pathMapper(path2);
|
|
@@ -67,7 +67,8 @@ var unpluginFactory = (options = {
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
generateBundle(_, bundle) {
|
|
70
|
-
|
|
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
|
|
84
|
+
for (const [fileName, chunk] of bundleEntries) {
|
|
84
85
|
if (chunk.type !== "chunk") {
|
|
85
86
|
continue;
|
|
86
87
|
}
|
package/dist/webpack.js
CHANGED
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.
|
|
4
|
+
"version": "0.0.17-alpha.1775970596430",
|
|
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",
|