code-inspector-plugin 0.18.1-beta.0 → 0.18.1-beta.1
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/index.js +1 -1
- package/dist/index.mjs +78 -306
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var b=Object.defineProperty,T=Object.defineProperties;var S=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var g=(e,t,n)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t)=>{for(var n in t||(t={}))_.call(t,n)&&g(e,n,t[n]);if(h)for(var n of h(t))q.call(t,n)&&g(e,n,t[n]);return e},v=(e,t)=>T(e,S(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("vite-code-inspector-plugin"),w=require("webpack-code-inspector-plugin"),i=require("code-inspector-core"),f=require("fs"),p=require("path"),F=require("chalk"),j=require("dotenv");var R=(e,t,n)=>new Promise((l,u)=>{var a=o=>{try{c(n.next(o))}catch(s){u(s)}},r=o=>{try{c(n.throw(o))}catch(s){u(s)}},c=o=>o.done?l(o.value):Promise.resolve(o.value).then(a,r);c((n=n.apply(e,t)).next())});const W="esbuild-code-inspector-plugin";function D(e){return{name:W,setup(t){if(e.close||!i.isDev(e.dev,!1))return;const n={port:0,entry:"",output:e.output},{escapeTags:l=[]}=e,u=new Map;t.onLoad({filter:e.match||/\.(jsx|tsx|js|ts|mjs|mts)?$/},a=>R(this,null,function*(){let r=a.path;r=i.getMappingFilePath(r,e.mappings);let c=yield f.promises.readFile(r,"utf8"),o=u.get(r);if(!o||o.originCode!==c){let s=c;if(r.match("node_modules")){if(!i.matchCondition(e.include||[],r))return s}else s=yield i.getCodeWithWebComponent({options:e,file:r,code:s,record:n});let d="";if(i.isJsTypeFile(r)?d="jsx":r.endsWith(".svelte")&&(d="svelte"),d)s=i.transformCode({content:s,filePath:r,fileType:d,escapeTags:l});else if(r.endsWith(".vue")){d="vue";const{descriptor:m}=i.parseSFC(s,{sourceMap:!1}),I=i.transformCode({content:m.template.content,filePath:r,fileType:d,escapeTags:l});s=s.replace(m.template.content,I)}const y=p.extname(r).replace(".","");o={originCode:c,output:{contents:s,loader:y}},u.set(r,o)}return o.output}))}}}function P(e){if(!(e!=null&&e.bundler)){console.log(F.red("Please specify the bundler in the options of code-inspector-plugin."));return}let t=!1;if(e.needEnvInspector)if(t=!0,process.env.CODE_INSPECTOR==="true")t=!1;else{const a=p.resolve(process.cwd(),".env.local");if(f.existsSync(a)){const r=f.readFileSync(a,"utf-8"),c=j.parse(r||"");(c==null?void 0:c.CODE_INSPECTOR)==="true"&&(t=!1)}}let n="";typeof __dirname!="undefined"?n=__dirname:n=p.dirname(i.fileURLToPath(typeof document=="undefined"?require("url").pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("index.js",document.baseURI).href));const l=v(C({},e),{close:t,output:p.resolve(n,"./")});return e.bundler==="webpack"||e.bundler==="rspack"?new w(l):e.bundler==="esbuild"?D(l):x.ViteCodeInspectorPlugin(l)}const E=P;exports.CodeInspectorPlugin=P;exports.codeInspectorPlugin=E;
|
package/dist/index.mjs
CHANGED
|
@@ -1,329 +1,101 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var x = Object.prototype.hasOwnProperty,
|
|
5
|
-
var
|
|
1
|
+
var b = Object.defineProperty, I = Object.defineProperties;
|
|
2
|
+
var T = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var m = Object.getOwnPropertySymbols;
|
|
4
|
+
var x = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var h = (e, t, n) => t in e ? b(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, v = (e, t) => {
|
|
6
6
|
for (var n in t || (t = {}))
|
|
7
|
-
x.call(t, n) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var n of
|
|
10
|
-
|
|
7
|
+
x.call(t, n) && h(e, n, t[n]);
|
|
8
|
+
if (m)
|
|
9
|
+
for (var n of m(t))
|
|
10
|
+
_.call(t, n) && h(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
import { ViteCodeInspectorPlugin as
|
|
14
|
-
import
|
|
15
|
-
import { isDev as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
}, g = (e, t) => I(e, T(t));
|
|
13
|
+
import { ViteCodeInspectorPlugin as w } from "vite-code-inspector-plugin";
|
|
14
|
+
import F from "webpack-code-inspector-plugin";
|
|
15
|
+
import { isDev as W, getMappingFilePath as D, matchCondition as E, getCodeWithWebComponent as S, isJsTypeFile as j, parseSFC as k, transformCode as C, fileURLToPath as O } from "code-inspector-core";
|
|
16
|
+
import u from "fs";
|
|
17
|
+
import d, { dirname as M } from "path";
|
|
18
|
+
import R from "chalk";
|
|
19
|
+
import L from "dotenv";
|
|
20
|
+
var N = (e, t, n) => new Promise((i, c) => {
|
|
21
|
+
var a = (o) => {
|
|
21
22
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
c(
|
|
23
|
+
l(n.next(o));
|
|
24
|
+
} catch (s) {
|
|
25
|
+
c(s);
|
|
25
26
|
}
|
|
26
|
-
},
|
|
27
|
+
}, r = (o) => {
|
|
27
28
|
try {
|
|
28
|
-
|
|
29
|
-
} catch (
|
|
30
|
-
c(
|
|
29
|
+
l(n.throw(o));
|
|
30
|
+
} catch (s) {
|
|
31
|
+
c(s);
|
|
31
32
|
}
|
|
32
|
-
},
|
|
33
|
-
|
|
33
|
+
}, l = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(a, r);
|
|
34
|
+
l((n = n.apply(e, t)).next());
|
|
34
35
|
});
|
|
35
|
-
const
|
|
36
|
-
function
|
|
36
|
+
const J = "esbuild-code-inspector-plugin";
|
|
37
|
+
function U(e) {
|
|
37
38
|
return {
|
|
38
|
-
name:
|
|
39
|
+
name: J,
|
|
39
40
|
setup(t) {
|
|
40
|
-
if (e.close || !
|
|
41
|
+
if (e.close || !W(e.dev, !1))
|
|
41
42
|
return;
|
|
42
43
|
const n = {
|
|
43
44
|
port: 0,
|
|
44
45
|
entry: "",
|
|
45
46
|
output: e.output
|
|
46
|
-
}, { escapeTags:
|
|
47
|
+
}, { escapeTags: i = [] } = e, c = /* @__PURE__ */ new Map();
|
|
47
48
|
t.onLoad(
|
|
48
49
|
{ filter: e.match || /\.(jsx|tsx|js|ts|mjs|mts)?$/ },
|
|
49
|
-
(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
(a) => N(this, null, function* () {
|
|
51
|
+
let r = a.path;
|
|
52
|
+
r = D(r, e.mappings);
|
|
53
|
+
let l = yield u.promises.readFile(r, "utf8"), o = c.get(r);
|
|
54
|
+
if (!o || o.originCode !== l) {
|
|
55
|
+
let s = l;
|
|
56
|
+
if (r.match("node_modules")) {
|
|
57
|
+
if (!E(e.include || [], r))
|
|
58
|
+
return s;
|
|
59
|
+
} else
|
|
60
|
+
s = yield S({
|
|
61
|
+
options: e,
|
|
62
|
+
file: r,
|
|
63
|
+
code: s,
|
|
64
|
+
record: n
|
|
65
|
+
});
|
|
66
|
+
let p = "";
|
|
67
|
+
if (j(r) ? p = "jsx" : r.endsWith(".svelte") && (p = "svelte"), p)
|
|
68
|
+
s = C({
|
|
69
|
+
content: s,
|
|
70
|
+
filePath: r,
|
|
63
71
|
fileType: p,
|
|
64
|
-
escapeTags:
|
|
72
|
+
escapeTags: i
|
|
65
73
|
});
|
|
66
|
-
else if (
|
|
74
|
+
else if (r.endsWith(".vue")) {
|
|
67
75
|
p = "vue";
|
|
68
|
-
const { descriptor:
|
|
76
|
+
const { descriptor: f } = k(s, {
|
|
69
77
|
sourceMap: !1
|
|
70
|
-
}),
|
|
71
|
-
content:
|
|
72
|
-
filePath:
|
|
78
|
+
}), y = C({
|
|
79
|
+
content: f.template.content,
|
|
80
|
+
filePath: r,
|
|
73
81
|
fileType: p,
|
|
74
|
-
escapeTags:
|
|
82
|
+
escapeTags: i
|
|
75
83
|
});
|
|
76
|
-
|
|
84
|
+
s = s.replace(f.template.content, y);
|
|
77
85
|
}
|
|
78
|
-
const
|
|
79
|
-
|
|
86
|
+
const P = d.extname(r).replace(".", "");
|
|
87
|
+
o = { originCode: l, output: { contents: s, loader: P } }, c.set(r, o);
|
|
80
88
|
}
|
|
81
|
-
return
|
|
89
|
+
return o.output;
|
|
82
90
|
})
|
|
83
91
|
);
|
|
84
92
|
}
|
|
85
93
|
};
|
|
86
94
|
}
|
|
87
|
-
function
|
|
88
|
-
if (e.__esModule)
|
|
89
|
-
return e;
|
|
90
|
-
var t = e.default;
|
|
91
|
-
if (typeof t == "function") {
|
|
92
|
-
var n = function s() {
|
|
93
|
-
if (this instanceof s) {
|
|
94
|
-
var c = [null];
|
|
95
|
-
c.push.apply(c, arguments);
|
|
96
|
-
var r = Function.bind.apply(t, c);
|
|
97
|
-
return new r();
|
|
98
|
-
}
|
|
99
|
-
return t.apply(this, arguments);
|
|
100
|
-
};
|
|
101
|
-
n.prototype = t.prototype;
|
|
102
|
-
} else
|
|
103
|
-
n = {};
|
|
104
|
-
return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(s) {
|
|
105
|
-
var c = Object.getOwnPropertyDescriptor(e, s);
|
|
106
|
-
Object.defineProperty(n, s, c.get ? c : {
|
|
107
|
-
enumerable: !0,
|
|
108
|
-
get: function() {
|
|
109
|
-
return e[s];
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}), n;
|
|
113
|
-
}
|
|
114
|
-
var d = {}, G = {
|
|
115
|
-
get exports() {
|
|
116
|
-
return d;
|
|
117
|
-
},
|
|
118
|
-
set exports(e) {
|
|
119
|
-
d = e;
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
const Q = {}, z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
123
|
-
__proto__: null,
|
|
124
|
-
default: Q
|
|
125
|
-
}, Symbol.toStringTag, { value: "Module" })), O = /* @__PURE__ */ J(z), H = "dotenv", X = "16.3.1", Z = "Loads environment variables from .env file", ee = "lib/main.js", te = "lib/main.d.ts", ne = {
|
|
126
|
-
".": {
|
|
127
|
-
types: "./lib/main.d.ts",
|
|
128
|
-
require: "./lib/main.js",
|
|
129
|
-
default: "./lib/main.js"
|
|
130
|
-
},
|
|
131
|
-
"./config": "./config.js",
|
|
132
|
-
"./config.js": "./config.js",
|
|
133
|
-
"./lib/env-options": "./lib/env-options.js",
|
|
134
|
-
"./lib/env-options.js": "./lib/env-options.js",
|
|
135
|
-
"./lib/cli-options": "./lib/cli-options.js",
|
|
136
|
-
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
137
|
-
"./package.json": "./package.json"
|
|
138
|
-
}, re = {
|
|
139
|
-
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
140
|
-
lint: "standard",
|
|
141
|
-
"lint-readme": "standard-markdown",
|
|
142
|
-
pretest: "npm run lint && npm run dts-check",
|
|
143
|
-
test: "tap tests/*.js --100 -Rspec",
|
|
144
|
-
prerelease: "npm test",
|
|
145
|
-
release: "standard-version"
|
|
146
|
-
}, oe = {
|
|
147
|
-
type: "git",
|
|
148
|
-
url: "git://github.com/motdotla/dotenv.git"
|
|
149
|
-
}, se = "https://github.com/motdotla/dotenv?sponsor=1", ce = [
|
|
150
|
-
"dotenv",
|
|
151
|
-
"env",
|
|
152
|
-
".env",
|
|
153
|
-
"environment",
|
|
154
|
-
"variables",
|
|
155
|
-
"config",
|
|
156
|
-
"settings"
|
|
157
|
-
], ie = "README.md", ae = "BSD-2-Clause", le = {
|
|
158
|
-
"@definitelytyped/dtslint": "^0.0.133",
|
|
159
|
-
"@types/node": "^18.11.3",
|
|
160
|
-
decache: "^4.6.1",
|
|
161
|
-
sinon: "^14.0.1",
|
|
162
|
-
standard: "^17.0.0",
|
|
163
|
-
"standard-markdown": "^7.1.0",
|
|
164
|
-
"standard-version": "^9.5.0",
|
|
165
|
-
tap: "^16.3.0",
|
|
166
|
-
tar: "^6.1.11",
|
|
167
|
-
typescript: "^4.8.4"
|
|
168
|
-
}, ue = {
|
|
169
|
-
node: ">=12"
|
|
170
|
-
}, pe = {
|
|
171
|
-
fs: !1
|
|
172
|
-
}, de = {
|
|
173
|
-
name: H,
|
|
174
|
-
version: X,
|
|
175
|
-
description: Z,
|
|
176
|
-
main: ee,
|
|
177
|
-
types: te,
|
|
178
|
-
exports: ne,
|
|
179
|
-
scripts: re,
|
|
180
|
-
repository: oe,
|
|
181
|
-
funding: se,
|
|
182
|
-
keywords: ce,
|
|
183
|
-
readmeFilename: ie,
|
|
184
|
-
license: ae,
|
|
185
|
-
devDependencies: le,
|
|
186
|
-
engines: ue,
|
|
187
|
-
browser: pe
|
|
188
|
-
}, T = f, m = v, fe = O, ve = O, ge = de, h = ge.version, me = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
189
|
-
function he(e) {
|
|
190
|
-
const t = {};
|
|
191
|
-
let n = e.toString();
|
|
192
|
-
n = n.replace(/\r\n?/mg, "\n");
|
|
193
|
-
let s;
|
|
194
|
-
for (; (s = me.exec(n)) != null; ) {
|
|
195
|
-
const c = s[1];
|
|
196
|
-
let r = s[2] || "";
|
|
197
|
-
r = r.trim();
|
|
198
|
-
const o = r[0];
|
|
199
|
-
r = r.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), o === '"' && (r = r.replace(/\\n/g, "\n"), r = r.replace(/\\r/g, "\r")), t[c] = r;
|
|
200
|
-
}
|
|
201
|
-
return t;
|
|
202
|
-
}
|
|
203
|
-
function ye(e) {
|
|
204
|
-
const t = j(e), n = l.configDotenv({ path: t });
|
|
205
|
-
if (!n.parsed)
|
|
206
|
-
throw new Error("MISSING_DATA: Cannot parse ".concat(t, " for an unknown reason"));
|
|
207
|
-
const s = N(e).split(","), c = s.length;
|
|
208
|
-
let r;
|
|
209
|
-
for (let o = 0; o < c; o++)
|
|
210
|
-
try {
|
|
211
|
-
const i = s[o].trim(), a = be(n, i);
|
|
212
|
-
r = l.decrypt(a.ciphertext, a.key);
|
|
213
|
-
break;
|
|
214
|
-
} catch (i) {
|
|
215
|
-
if (o + 1 >= c)
|
|
216
|
-
throw i;
|
|
217
|
-
}
|
|
218
|
-
return l.parse(r);
|
|
219
|
-
}
|
|
220
|
-
function Ee(e) {
|
|
221
|
-
console.log("[dotenv@".concat(h, "][INFO] ").concat(e));
|
|
222
|
-
}
|
|
223
|
-
function _e(e) {
|
|
224
|
-
console.log("[dotenv@".concat(h, "][WARN] ").concat(e));
|
|
225
|
-
}
|
|
226
|
-
function g(e) {
|
|
227
|
-
console.log("[dotenv@".concat(h, "][DEBUG] ").concat(e));
|
|
228
|
-
}
|
|
229
|
-
function N(e) {
|
|
230
|
-
return e && e.DOTENV_KEY && e.DOTENV_KEY.length > 0 ? e.DOTENV_KEY : process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0 ? process.env.DOTENV_KEY : "";
|
|
231
|
-
}
|
|
232
|
-
function be(e, t) {
|
|
233
|
-
let n;
|
|
234
|
-
try {
|
|
235
|
-
n = new URL(t);
|
|
236
|
-
} catch (i) {
|
|
237
|
-
throw i.code === "ERR_INVALID_URL" ? new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development") : i;
|
|
238
|
-
}
|
|
239
|
-
const s = n.password;
|
|
240
|
-
if (!s)
|
|
241
|
-
throw new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
242
|
-
const c = n.searchParams.get("environment");
|
|
243
|
-
if (!c)
|
|
244
|
-
throw new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
245
|
-
const r = "DOTENV_VAULT_".concat(c.toUpperCase()), o = e.parsed[r];
|
|
246
|
-
if (!o)
|
|
247
|
-
throw new Error("NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ".concat(r, " in your .env.vault file."));
|
|
248
|
-
return { ciphertext: o, key: s };
|
|
249
|
-
}
|
|
250
|
-
function j(e) {
|
|
251
|
-
let t = m.resolve(process.cwd(), ".env");
|
|
252
|
-
return e && e.path && e.path.length > 0 && (t = e.path), t.endsWith(".vault") ? t : "".concat(t, ".vault");
|
|
253
|
-
}
|
|
254
|
-
function we(e) {
|
|
255
|
-
return e[0] === "~" ? m.join(fe.homedir(), e.slice(1)) : e;
|
|
256
|
-
}
|
|
257
|
-
function De(e) {
|
|
258
|
-
Ee("Loading env from encrypted .env.vault");
|
|
259
|
-
const t = l._parseVault(e);
|
|
260
|
-
let n = process.env;
|
|
261
|
-
return e && e.processEnv != null && (n = e.processEnv), l.populate(n, t, e), { parsed: t };
|
|
262
|
-
}
|
|
263
|
-
function Oe(e) {
|
|
264
|
-
let t = m.resolve(process.cwd(), ".env"), n = "utf8";
|
|
265
|
-
const s = !!(e && e.debug);
|
|
266
|
-
e && (e.path != null && (t = we(e.path)), e.encoding != null && (n = e.encoding));
|
|
267
|
-
try {
|
|
268
|
-
const c = l.parse(T.readFileSync(t, { encoding: n }));
|
|
269
|
-
let r = process.env;
|
|
270
|
-
return e && e.processEnv != null && (r = e.processEnv), l.populate(r, c, e), { parsed: c };
|
|
271
|
-
} catch (c) {
|
|
272
|
-
return s && g("Failed to load ".concat(t, " ").concat(c.message)), { error: c };
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
function Te(e) {
|
|
276
|
-
const t = j(e);
|
|
277
|
-
return N(e).length === 0 ? l.configDotenv(e) : T.existsSync(t) ? l._configVault(e) : (_e("You set DOTENV_KEY but you are missing a .env.vault file at ".concat(t, ". Did you forget to build it?")), l.configDotenv(e));
|
|
278
|
-
}
|
|
279
|
-
function Ne(e, t) {
|
|
280
|
-
const n = Buffer.from(t.slice(-64), "hex");
|
|
281
|
-
let s = Buffer.from(e, "base64");
|
|
282
|
-
const c = s.slice(0, 12), r = s.slice(-16);
|
|
283
|
-
s = s.slice(12, -16);
|
|
284
|
-
try {
|
|
285
|
-
const o = ve.createDecipheriv("aes-256-gcm", n, c);
|
|
286
|
-
return o.setAuthTag(r), "".concat(o.update(s)).concat(o.final());
|
|
287
|
-
} catch (o) {
|
|
288
|
-
const i = o instanceof RangeError, a = o.message === "Invalid key length", u = o.message === "Unsupported state or unable to authenticate data";
|
|
289
|
-
if (i || a) {
|
|
290
|
-
const p = "INVALID_DOTENV_KEY: It must be 64 characters long (or more)";
|
|
291
|
-
throw new Error(p);
|
|
292
|
-
} else if (u) {
|
|
293
|
-
const p = "DECRYPTION_FAILED: Please check your DOTENV_KEY";
|
|
294
|
-
throw new Error(p);
|
|
295
|
-
} else
|
|
296
|
-
throw console.error("Error: ", o.code), console.error("Error: ", o.message), o;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
function je(e, t, n = {}) {
|
|
300
|
-
const s = !!(n && n.debug), c = !!(n && n.override);
|
|
301
|
-
if (typeof t != "object")
|
|
302
|
-
throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
303
|
-
for (const r of Object.keys(t))
|
|
304
|
-
Object.prototype.hasOwnProperty.call(e, r) ? (c === !0 && (e[r] = t[r]), s && g(c === !0 ? '"'.concat(r, '" is already defined and WAS overwritten') : '"'.concat(r, '" is already defined and was NOT overwritten'))) : e[r] = t[r];
|
|
305
|
-
}
|
|
306
|
-
const l = {
|
|
307
|
-
configDotenv: Oe,
|
|
308
|
-
_configVault: De,
|
|
309
|
-
_parseVault: ye,
|
|
310
|
-
config: Te,
|
|
311
|
-
decrypt: Ne,
|
|
312
|
-
parse: he,
|
|
313
|
-
populate: je
|
|
314
|
-
};
|
|
315
|
-
d.configDotenv = l.configDotenv;
|
|
316
|
-
d._configVault = l._configVault;
|
|
317
|
-
d._parseVault = l._parseVault;
|
|
318
|
-
d.config = l.config;
|
|
319
|
-
d.decrypt = l.decrypt;
|
|
320
|
-
d.parse = l.parse;
|
|
321
|
-
d.populate = l.populate;
|
|
322
|
-
G.exports = l;
|
|
323
|
-
function Ie(e) {
|
|
95
|
+
function V(e) {
|
|
324
96
|
if (!(e != null && e.bundler)) {
|
|
325
97
|
console.log(
|
|
326
|
-
|
|
98
|
+
R.red(
|
|
327
99
|
"Please specify the bundler in the options of code-inspector-plugin."
|
|
328
100
|
)
|
|
329
101
|
);
|
|
@@ -334,22 +106,22 @@ function Ie(e) {
|
|
|
334
106
|
if (t = !0, process.env.CODE_INSPECTOR === "true")
|
|
335
107
|
t = !1;
|
|
336
108
|
else {
|
|
337
|
-
const
|
|
338
|
-
if (
|
|
339
|
-
const
|
|
340
|
-
(
|
|
109
|
+
const a = d.resolve(process.cwd(), ".env.local");
|
|
110
|
+
if (u.existsSync(a)) {
|
|
111
|
+
const r = u.readFileSync(a, "utf-8"), l = L.parse(r || "");
|
|
112
|
+
(l == null ? void 0 : l.CODE_INSPECTOR) === "true" && (t = !1);
|
|
341
113
|
}
|
|
342
114
|
}
|
|
343
115
|
let n = "";
|
|
344
|
-
typeof __dirname != "undefined" ? n = __dirname : n = M(
|
|
345
|
-
const
|
|
116
|
+
typeof __dirname != "undefined" ? n = __dirname : n = M(O(import.meta.url));
|
|
117
|
+
const i = g(v({}, e), {
|
|
346
118
|
close: t,
|
|
347
|
-
output:
|
|
119
|
+
output: d.resolve(n, "./")
|
|
348
120
|
});
|
|
349
|
-
return e.bundler === "webpack" || e.bundler === "rspack" ? new
|
|
121
|
+
return e.bundler === "webpack" || e.bundler === "rspack" ? new F(i) : e.bundler === "esbuild" ? U(i) : w(i);
|
|
350
122
|
}
|
|
351
|
-
const
|
|
123
|
+
const Q = V;
|
|
352
124
|
export {
|
|
353
|
-
|
|
354
|
-
|
|
125
|
+
V as CodeInspectorPlugin,
|
|
126
|
+
Q as codeInspectorPlugin
|
|
355
127
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-inspector-plugin",
|
|
3
|
-
"version": "0.18.1-beta.
|
|
3
|
+
"version": "0.18.1-beta.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"typings": "./types/index.d.ts",
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"chalk": "4.1.1",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"esbuild-code-inspector-plugin": "0.18.1-beta.
|
|
50
|
+
"dotenv": "^16.3.1",
|
|
51
|
+
"code-inspector-core": "0.18.1-beta.1",
|
|
52
|
+
"vite-code-inspector-plugin": "0.18.1-beta.1",
|
|
53
|
+
"esbuild-code-inspector-plugin": "0.18.1-beta.1",
|
|
54
|
+
"webpack-code-inspector-plugin": "0.18.1-beta.1"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@types/node": "^16.0.1",
|
|
57
|
-
"dotenv": "^16.3.1",
|
|
58
58
|
"typescript": "^4.9.3",
|
|
59
59
|
"vite": "^4.1.0"
|
|
60
60
|
},
|