@uni_toolkit/unplugin-json-optimization 0.0.11 → 0.0.13

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.
@@ -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, (_, quote, path2) => {
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 code;
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, (_, quote, path2) => {
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 code;
47
+ return match;
48
48
  });
49
49
  }
50
50
  var unpluginFactory = (options = {
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  src_default,
3
3
  unplugin,
4
4
  unpluginFactory
5
- } from "./chunk-E4HM7IM2.js";
5
+ } from "./chunk-ZDVJORCZ.js";
6
6
  export {
7
7
  src_default as default,
8
8
  unplugin,
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, (_, quote, path2) => {
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 code;
48
+ return match;
49
49
  });
50
50
  }
51
51
  var unpluginFactory = (options = {
package/dist/vite.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-E4HM7IM2.js";
3
+ } from "./chunk-ZDVJORCZ.js";
4
4
 
5
5
  // src/vite.ts
6
6
  import { createVitePlugin } from "unplugin";
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, (_, quote, path2) => {
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 code;
48
+ return match;
49
49
  });
50
50
  }
51
51
  var unpluginFactory = (options = {
@@ -1,7 +1,7 @@
1
- import * as _unplugin from 'unplugin';
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) => _unplugin.WebpackPluginInstance;
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 _unplugin from 'unplugin';
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) => _unplugin.WebpackPluginInstance;
5
+ declare const _default: (options?: Options | undefined) => webpack.WebpackPluginInstance;
6
6
 
7
7
  export { _default as default };
package/dist/webpack.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-E4HM7IM2.js";
3
+ } from "./chunk-ZDVJORCZ.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.11",
4
+ "version": "0.0.13",
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": "^4.2.0",
74
+ "@rollup/pluginutils": "^5.3.0",
75
75
  "unplugin": "^2.3.4"
76
76
  },
77
77
  "devDependencies": {