@code-inspector/turbopack 1.4.5 → 1.4.6
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 +34 -28
- package/package.json +3 -3
- package/types/index.d.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var f=Object.
|
|
1
|
+
"use strict";var f=Object.defineProperty,j=Object.defineProperties;var v=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var c=(e,t,o)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,r=(e,t)=>{for(var o in t||(t={}))b.call(t,o)&&c(e,o,t[o]);if(i)for(var o of i(t))g.call(t,o)&&c(e,o,t[o]);return e},s=(e,t)=>j(e,v(t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@code-inspector/core"),y=require("path"),k=require("url");function a(e){if(typeof e.importMetaResolve=="function"){const t=e.importMetaResolve("@code-inspector/webpack");return k.fileURLToPath(t)}return typeof e.requireResolve=="function"?e.requireResolve("@code-inspector/webpack"):null}function m(e){var n;if(e.close||!u.isDev(e.dev,process.env.NODE_ENV==="development"))return{};const t={port:0,entry:"",output:e.output},o=a({requireResolve:(n=globalThis.require)==null?void 0:n.resolve,importMetaResolve:void 0}),l=y.resolve(o,".."),d=["*.jsx","*.tsx","layout.js","layout.ts","page.js","page.ts","loading.js","loading.ts","not-found.js","not-found.ts","error.js","error.ts","global-error.js","global-error.ts","template.js","template.ts","default.js","default.ts"],p="**/{".concat(d.join(","),"}");return{[u.isNextGET16()?"**/*.{jsx,tsx,js,ts,mjs,mts}":p]:{loaders:[{loader:"".concat(l,"/loader.js"),options:s(r({},e),{record:t})},{loader:"".concat(l,"/inject-loader.js"),options:s(r({},e),{record:t})}]}}}exports.TurbopackCodeInspectorPlugin=m;exports.resolveWebpackEntry=a;
|
package/dist/index.mjs
CHANGED
|
@@ -1,34 +1,39 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p = Object.defineProperty, d = Object.defineProperties;
|
|
2
2
|
var f = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var i = Object.getOwnPropertySymbols;
|
|
4
|
-
var j = Object.prototype.hasOwnProperty,
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
j.call(
|
|
4
|
+
var j = Object.prototype.hasOwnProperty, v = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var c = (e, o, t) => o in e ? p(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, r = (e, o) => {
|
|
6
|
+
for (var t in o || (o = {}))
|
|
7
|
+
j.call(o, t) && c(e, t, o[t]);
|
|
8
8
|
if (i)
|
|
9
|
-
for (var
|
|
10
|
-
|
|
9
|
+
for (var t of i(o))
|
|
10
|
+
v.call(o, t) && c(e, t, o[t]);
|
|
11
11
|
return e;
|
|
12
|
-
}, s = (e,
|
|
13
|
-
import { isDev as
|
|
14
|
-
import
|
|
15
|
-
import { fileURLToPath as
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
12
|
+
}, s = (e, o) => d(e, f(o));
|
|
13
|
+
import { isDev as m, isNextGET16 as b } from "@code-inspector/core";
|
|
14
|
+
import g from "path";
|
|
15
|
+
import { fileURLToPath as y } from "url";
|
|
16
|
+
function R(e) {
|
|
17
|
+
if (typeof e.importMetaResolve == "function") {
|
|
18
|
+
const o = e.importMetaResolve(
|
|
19
|
+
"@code-inspector/webpack"
|
|
20
|
+
);
|
|
21
|
+
return y(o);
|
|
22
|
+
}
|
|
23
|
+
return typeof e.requireResolve == "function" ? e.requireResolve("@code-inspector/webpack") : null;
|
|
24
|
+
}
|
|
25
|
+
function D(e) {
|
|
26
|
+
var n;
|
|
27
|
+
if (e.close || !m(e.dev, process.env.NODE_ENV === "development"))
|
|
18
28
|
return {};
|
|
19
|
-
const
|
|
29
|
+
const o = {
|
|
20
30
|
port: 0,
|
|
21
31
|
entry: "",
|
|
22
32
|
output: e.output
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"@code-inspector/webpack"
|
|
28
|
-
);
|
|
29
|
-
o = b(u);
|
|
30
|
-
}
|
|
31
|
-
const l = y.resolve(o, ".."), a = [
|
|
33
|
+
}, t = R({
|
|
34
|
+
requireResolve: (n = globalThis.require) == null ? void 0 : n.resolve,
|
|
35
|
+
importMetaResolve: import.meta.resolve
|
|
36
|
+
}), l = g.resolve(t, ".."), a = [
|
|
32
37
|
"*.jsx",
|
|
33
38
|
"*.tsx",
|
|
34
39
|
"layout.js",
|
|
@@ -47,20 +52,20 @@ function q(e) {
|
|
|
47
52
|
"template.ts",
|
|
48
53
|
"default.js",
|
|
49
54
|
"default.ts"
|
|
50
|
-
],
|
|
55
|
+
], u = "**/{".concat(a.join(","), "}");
|
|
51
56
|
return {
|
|
52
|
-
[
|
|
57
|
+
[b() ? "**/*.{jsx,tsx,js,ts,mjs,mts}" : u]: {
|
|
53
58
|
loaders: [
|
|
54
59
|
{
|
|
55
60
|
loader: "".concat(l, "/loader.js"),
|
|
56
61
|
options: s(r({}, e), {
|
|
57
|
-
record:
|
|
62
|
+
record: o
|
|
58
63
|
})
|
|
59
64
|
},
|
|
60
65
|
{
|
|
61
66
|
loader: "".concat(l, "/inject-loader.js"),
|
|
62
67
|
options: s(r({}, e), {
|
|
63
|
-
record:
|
|
68
|
+
record: o
|
|
64
69
|
})
|
|
65
70
|
}
|
|
66
71
|
]
|
|
@@ -68,5 +73,6 @@ function q(e) {
|
|
|
68
73
|
};
|
|
69
74
|
}
|
|
70
75
|
export {
|
|
71
|
-
|
|
76
|
+
D as TurbopackCodeInspectorPlugin,
|
|
77
|
+
R as resolveWebpackEntry
|
|
72
78
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-inspector/turbopack",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"typings": "./types/index.d.ts",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"url": "https://github.com/zh-lx/code-inspector/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@code-inspector/core": "1.4.
|
|
41
|
-
"@code-inspector/webpack": "1.4.
|
|
40
|
+
"@code-inspector/core": "1.4.6",
|
|
41
|
+
"@code-inspector/webpack": "1.4.6"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^16.0.1",
|
package/types/index.d.ts
CHANGED
|
@@ -3,5 +3,9 @@ interface Options extends CodeOptions {
|
|
|
3
3
|
close?: boolean;
|
|
4
4
|
output: string;
|
|
5
5
|
}
|
|
6
|
+
export declare function resolveWebpackEntry(params: {
|
|
7
|
+
requireResolve?: (id: string) => string;
|
|
8
|
+
importMetaResolve?: (id: string) => string | Promise<string>;
|
|
9
|
+
}): string;
|
|
6
10
|
export declare function TurbopackCodeInspectorPlugin(options: Options): Record<string, any>;
|
|
7
11
|
export {};
|