@uni_toolkit/unplugin-json-optimization 0.0.11 → 0.0.12
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-E4HM7IM2.js → chunk-ZDVJORCZ.js} +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/vite.cjs +2 -2
- package/dist/vite.js +1 -1
- package/dist/webpack.cjs +2 -2
- package/dist/webpack.d.cts +2 -2
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +1 -1
- package/package.json +2 -2
|
@@ -3,12 +3,12 @@ import { createUnplugin } from "unplugin";
|
|
|
3
3
|
import { createFilter } from "@rollup/pluginutils";
|
|
4
4
|
import path from "path";
|
|
5
5
|
function replaceRequirePaths(code, pathMapper) {
|
|
6
|
-
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (
|
|
6
|
+
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (match, quote, path2) => {
|
|
7
7
|
const newPath = pathMapper(path2);
|
|
8
8
|
if (newPath && newPath !== path2) {
|
|
9
9
|
return `require(${quote}${newPath}${quote})`;
|
|
10
10
|
}
|
|
11
|
-
return
|
|
11
|
+
return match;
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
var unpluginFactory = (options = {
|
package/dist/index.cjs
CHANGED
|
@@ -39,12 +39,12 @@ var import_unplugin = require("unplugin");
|
|
|
39
39
|
var import_pluginutils = require("@rollup/pluginutils");
|
|
40
40
|
var import_node_path = __toESM(require("path"), 1);
|
|
41
41
|
function replaceRequirePaths(code, pathMapper) {
|
|
42
|
-
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (
|
|
42
|
+
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (match, quote, path2) => {
|
|
43
43
|
const newPath = pathMapper(path2);
|
|
44
44
|
if (newPath && newPath !== path2) {
|
|
45
45
|
return `require(${quote}${newPath}${quote})`;
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return match;
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
var unpluginFactory = (options = {
|
package/dist/index.js
CHANGED
package/dist/vite.cjs
CHANGED
|
@@ -40,12 +40,12 @@ var import_unplugin = require("unplugin");
|
|
|
40
40
|
var import_pluginutils = require("@rollup/pluginutils");
|
|
41
41
|
var import_node_path = __toESM(require("path"), 1);
|
|
42
42
|
function replaceRequirePaths(code, pathMapper) {
|
|
43
|
-
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (
|
|
43
|
+
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (match, quote, path2) => {
|
|
44
44
|
const newPath = pathMapper(path2);
|
|
45
45
|
if (newPath && newPath !== path2) {
|
|
46
46
|
return `require(${quote}${newPath}${quote})`;
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return match;
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
var unpluginFactory = (options = {
|
package/dist/vite.js
CHANGED
package/dist/webpack.cjs
CHANGED
|
@@ -40,12 +40,12 @@ var import_unplugin = require("unplugin");
|
|
|
40
40
|
var import_pluginutils = require("@rollup/pluginutils");
|
|
41
41
|
var import_node_path = __toESM(require("path"), 1);
|
|
42
42
|
function replaceRequirePaths(code, pathMapper) {
|
|
43
|
-
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (
|
|
43
|
+
return code.replace(/require\s*\(\s*(["'])([^"']+)\1\s*\)/g, (match, quote, path2) => {
|
|
44
44
|
const newPath = pathMapper(path2);
|
|
45
45
|
if (newPath && newPath !== path2) {
|
|
46
46
|
return `require(${quote}${newPath}${quote})`;
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return match;
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
var unpluginFactory = (options = {
|
package/dist/webpack.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as webpack from 'webpack';
|
|
2
2
|
import { Options } from './types.cjs';
|
|
3
3
|
import '@rollup/pluginutils';
|
|
4
4
|
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => webpack.WebpackPluginInstance;
|
|
6
6
|
|
|
7
7
|
export { _default as default };
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as webpack from 'webpack';
|
|
2
2
|
import { Options } from './types.js';
|
|
3
3
|
import '@rollup/pluginutils';
|
|
4
4
|
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => webpack.WebpackPluginInstance;
|
|
6
6
|
|
|
7
7
|
export { _default as default };
|
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.12",
|
|
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",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@rollup/pluginutils": "^
|
|
74
|
+
"@rollup/pluginutils": "^5.3.0",
|
|
75
75
|
"unplugin": "^2.3.4"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|