@unpackjs/core 1.7.5 → 1.7.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.
Files changed (122) hide show
  1. package/compiled/css-loader/index.js +180 -178
  2. package/compiled/less-loader/index.js +11 -11
  3. package/compiled/line-diff/index.js +4 -4
  4. package/compiled/portfinder/index.js +37 -37
  5. package/compiled/postcss-loader/index.js +261 -256
  6. package/compiled/sass-loader/index.js +18 -18
  7. package/compiled/semver/index.js +188 -170
  8. package/compiled/semver/package.json +1 -1
  9. package/compiled/style-loader/index.js +13 -13
  10. package/compiled/webpack-bundle-analyzer/index.js +198 -198
  11. package/compiled/webpack-merge/index.js +29 -29
  12. package/dist/bundler-config/chunkSplit.cjs +169 -156
  13. package/dist/bundler-config/chunkSplit.d.ts +1 -1
  14. package/dist/bundler-config/chunkSplit.js +125 -134
  15. package/dist/bundler-config/css.cjs +181 -158
  16. package/dist/bundler-config/css.d.ts +1 -1
  17. package/dist/bundler-config/css.js +139 -151
  18. package/dist/bundler-config/experimentCss.cjs +203 -159
  19. package/dist/bundler-config/experimentCss.d.ts +1 -1
  20. package/dist/bundler-config/experimentCss.js +162 -152
  21. package/dist/bundler-config/helper.cjs +82 -78
  22. package/dist/bundler-config/helper.js +36 -55
  23. package/dist/bundler-config/index.cjs +260 -209
  24. package/dist/bundler-config/index.d.ts +1 -1
  25. package/dist/bundler-config/index.d.ts.map +1 -1
  26. package/dist/bundler-config/index.js +209 -182
  27. package/dist/bundler-config/jsMinify.cjs +114 -95
  28. package/dist/bundler-config/jsMinify.js +70 -73
  29. package/dist/colors.cjs +83 -56
  30. package/dist/colors.js +38 -37
  31. package/dist/config.cjs +107 -93
  32. package/dist/config.d.ts +1 -1
  33. package/dist/config.d.ts.map +1 -1
  34. package/dist/config.js +64 -70
  35. package/dist/constants.cjs +62 -62
  36. package/dist/constants.js +20 -38
  37. package/dist/createUnpack.cjs +111 -104
  38. package/dist/createUnpack.js +67 -82
  39. package/dist/global.cjs +36 -0
  40. package/dist/global.d.ts +2 -0
  41. package/dist/global.d.ts.map +1 -0
  42. package/dist/global.js +4 -0
  43. package/dist/index.cjs +174 -51
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +33 -15
  47. package/dist/lightningcss/cache.cjs +40 -32
  48. package/dist/lightningcss/cache.js +10 -20
  49. package/dist/lightningcss/loader.cjs +56 -53
  50. package/dist/lightningcss/loader.d.ts +1 -1
  51. package/dist/lightningcss/loader.js +25 -34
  52. package/dist/lightningcss/minimizer.cjs +90 -109
  53. package/dist/lightningcss/minimizer.d.ts +1 -1
  54. package/dist/lightningcss/minimizer.js +59 -87
  55. package/dist/logger.cjs +104 -98
  56. package/dist/logger.d.ts +1 -1
  57. package/dist/logger.js +59 -76
  58. package/dist/openBrowser.cjs +104 -81
  59. package/dist/openBrowser.js +56 -52
  60. package/dist/plugin-progress/rspack.cjs +104 -79
  61. package/dist/plugin-progress/rspack.d.ts +1 -1
  62. package/dist/plugin-progress/rspack.js +59 -57
  63. package/dist/plugin-progress/webpack.cjs +111 -89
  64. package/dist/plugin-progress/webpack.d.ts +1 -1
  65. package/dist/plugin-progress/webpack.js +65 -67
  66. package/dist/plugin.cjs +38 -29
  67. package/dist/plugin.js +8 -17
  68. package/dist/prebundleDeps.cjs +327 -337
  69. package/dist/prebundleDeps.d.ts.map +1 -1
  70. package/dist/prebundleDeps.js +278 -324
  71. package/dist/progressBar.cjs +82 -65
  72. package/dist/progressBar.js +38 -43
  73. package/dist/reporter.cjs +135 -120
  74. package/dist/reporter.js +88 -98
  75. package/dist/run/build.cjs +68 -67
  76. package/dist/run/build.d.ts +1 -1
  77. package/dist/run/build.js +24 -45
  78. package/dist/run/dev.cjs +96 -83
  79. package/dist/run/dev.d.ts +1 -1
  80. package/dist/run/dev.d.ts.map +1 -1
  81. package/dist/run/dev.js +50 -61
  82. package/dist/run/index.cjs +74 -21
  83. package/dist/run/index.js +2 -9
  84. package/dist/typed-css-modules/loader.cjs +179 -188
  85. package/dist/typed-css-modules/loader.d.ts +1 -1
  86. package/dist/typed-css-modules/loader.js +118 -151
  87. package/dist/typed-css-modules/plugin.cjs +113 -88
  88. package/dist/typed-css-modules/plugin.d.ts +1 -1
  89. package/dist/typed-css-modules/plugin.js +68 -66
  90. package/dist/typed-css-modules/utils.cjs +43 -42
  91. package/dist/typed-css-modules/utils.d.ts +1 -1
  92. package/dist/typed-css-modules/utils.js +13 -30
  93. package/dist/types/chunkSplit.cjs +19 -15
  94. package/dist/types/chunkSplit.d.ts +2 -10
  95. package/dist/types/chunkSplit.d.ts.map +1 -1
  96. package/dist/types/chunkSplit.js +2 -9
  97. package/dist/types/config.cjs +19 -15
  98. package/dist/types/config.d.ts +1 -1
  99. package/dist/types/config.js +2 -9
  100. package/dist/types/index.cjs +101 -27
  101. package/dist/types/index.js +2 -9
  102. package/dist/types/lightningcss.cjs +19 -15
  103. package/dist/types/lightningcss.js +2 -9
  104. package/dist/types/logger.cjs +43 -34
  105. package/dist/types/logger.js +13 -22
  106. package/dist/types/plugin.cjs +19 -15
  107. package/dist/types/plugin.js +2 -9
  108. package/dist/utils.cjs +280 -304
  109. package/dist/utils.js +195 -241
  110. package/dist/watchFiles.cjs +73 -0
  111. package/dist/watchFiles.d.ts +3 -0
  112. package/dist/watchFiles.d.ts.map +1 -0
  113. package/dist/watchFiles.js +27 -0
  114. package/package.json +14 -17
  115. package/compiled/commander/index.d.ts +0 -1047
  116. package/compiled/commander/index.js +0 -2428
  117. package/compiled/commander/license +0 -22
  118. package/compiled/commander/package.json +0 -1
  119. package/dist/bundleRequire.cjs +0 -200
  120. package/dist/bundleRequire.d.ts +0 -5
  121. package/dist/bundleRequire.d.ts.map +0 -1
  122. package/dist/bundleRequire.js +0 -173
@@ -1,22 +0,0 @@
1
- (The MIT License)
2
-
3
- Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- 'Software'), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1 +0,0 @@
1
- {"name":"commander","author":"TJ Holowaychuk <tj@vision-media.ca>","version":"13.0.0","license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -1,200 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var bundleRequire_exports = {};
29
- __export(bundleRequire_exports, {
30
- bundleRequire: () => bundleRequire,
31
- isBuiltin: () => isBuiltin,
32
- isFilePathESM: () => isFilePathESM,
33
- isNodeBuiltin: () => isNodeBuiltin
34
- });
35
- module.exports = __toCommonJS(bundleRequire_exports);
36
- var import_node_fs = __toESM(require("node:fs"));
37
- var import_node_module = require("node:module");
38
- var import_node_path = __toESM(require("node:path"));
39
- var import_node_url = require("node:url");
40
- var import_node_util = require("node:util");
41
- var import_esbuild = require("esbuild");
42
- const promisifiedRealpath = (0, import_node_util.promisify)(import_node_fs.default.realpath);
43
- async function bundleRequire(resolvedPath) {
44
- const isESM = isFilePathESM(resolvedPath);
45
- const bundled = await bundleConfigFile(resolvedPath, isESM);
46
- const userConfig = await loadConfigFromBundledFile(resolvedPath, bundled.code, isESM);
47
- return userConfig;
48
- }
49
- async function bundleConfigFile(fileName, isESM) {
50
- const dirnameVarName = "__injected_original_dirname";
51
- const filenameVarName = "__injected_original_filename";
52
- const importMetaUrlVarName = "__injected_original_import_meta_url";
53
- const result = await (0, import_esbuild.build)({
54
- absWorkingDir: process.cwd(),
55
- entryPoints: [fileName],
56
- write: false,
57
- target: ["node18"],
58
- platform: "node",
59
- bundle: true,
60
- format: isESM ? "esm" : "cjs",
61
- mainFields: ["main"],
62
- sourcemap: "inline",
63
- metafile: true,
64
- define: {
65
- __dirname: dirnameVarName,
66
- __filename: filenameVarName,
67
- "import.meta.url": importMetaUrlVarName,
68
- "import.meta.dirname": dirnameVarName,
69
- "import.meta.filename": filenameVarName
70
- },
71
- plugins: [
72
- {
73
- name: "externalize-deps",
74
- setup(build2) {
75
- build2.onResolve({ filter: /^[^.].*/ }, async ({ path: id, kind }) => {
76
- if (kind === "entry-point" || import_node_path.default.isAbsolute(id) || isNodeBuiltin(id)) {
77
- return;
78
- }
79
- if (isBuiltin(id)) {
80
- return { external: true };
81
- }
82
- const isImport = isESM || kind === "dynamic-import";
83
- let idFsPath;
84
- if (!isImport) {
85
- const canResolveWithImport = false;
86
- if (canResolveWithImport) {
87
- throw new Error(
88
- `Failed to resolve ${JSON.stringify(
89
- id
90
- )}. This package is ESM only but it was tried to load by \`require\`.`
91
- );
92
- }
93
- }
94
- if (idFsPath && isImport) {
95
- idFsPath = (0, import_node_url.pathToFileURL)(idFsPath).href;
96
- }
97
- if (idFsPath && !isImport && isFilePathESM(idFsPath)) {
98
- throw new Error(
99
- `${JSON.stringify(
100
- id
101
- )} resolved to an ESM file. ESM file cannot be loaded by \`require\`.`
102
- );
103
- }
104
- return {
105
- path: idFsPath,
106
- external: true
107
- };
108
- });
109
- }
110
- },
111
- {
112
- name: "inject-file-scope-variables",
113
- setup(build2) {
114
- build2.onLoad({ filter: /\.[cm]?[jt]s$/ }, async (args) => {
115
- const contents = import_node_fs.default.readFileSync(args.path, "utf-8");
116
- const injectValues = `const ${dirnameVarName} = ${JSON.stringify(import_node_path.default.dirname(args.path))};const ${filenameVarName} = ${JSON.stringify(args.path)};const ${importMetaUrlVarName} = ${JSON.stringify((0, import_node_url.pathToFileURL)(args.path).href)};`;
117
- return {
118
- loader: args.path.endsWith("ts") ? "ts" : "js",
119
- contents: injectValues + contents
120
- };
121
- });
122
- }
123
- }
124
- ]
125
- });
126
- const { text } = result.outputFiles[0];
127
- return {
128
- code: text,
129
- dependencies: result.metafile ? Object.keys(result.metafile.inputs) : []
130
- };
131
- }
132
- async function loadConfigFromBundledFile(fileName, bundledCode, isESM) {
133
- if (isESM) {
134
- const fileBase = `${fileName}.timestamp-${Date.now()}-${Math.random().toString(16).slice(2)}`;
135
- const fileNameTmp = `${fileBase}.mjs`;
136
- const fileUrl = `${(0, import_node_url.pathToFileURL)(fileBase)}.mjs`;
137
- import_node_fs.default.writeFileSync(fileNameTmp, bundledCode);
138
- try {
139
- return (await import(fileUrl)).default;
140
- } finally {
141
- import_node_fs.default.unlink(fileNameTmp, () => {
142
- });
143
- }
144
- } else {
145
- const extension = import_node_path.default.extname(fileName);
146
- const realFileName = await promisifiedRealpath(fileName);
147
- const loaderExt = extension in require.extensions ? extension : ".js";
148
- const defaultLoader = require.extensions[loaderExt];
149
- require.extensions[loaderExt] = (module2, filename) => {
150
- if (filename === realFileName) {
151
- ;
152
- module2._compile(bundledCode, filename);
153
- } else {
154
- defaultLoader(module2, filename);
155
- }
156
- };
157
- delete require.cache[require.resolve(fileName)];
158
- const raw = require(fileName);
159
- require.extensions[loaderExt] = defaultLoader;
160
- return raw.__esModule ? raw.default : raw;
161
- }
162
- }
163
- function isFilePathESM(filePath) {
164
- if (/\.m[jt]s$/.test(filePath)) {
165
- return true;
166
- }
167
- if (/\.c[jt]s$/.test(filePath)) {
168
- return false;
169
- }
170
- try {
171
- const pkgPath = import_node_path.default.join(import_node_path.default.dirname(filePath), "package.json");
172
- const pkgData = JSON.parse(import_node_fs.default.readFileSync(pkgPath, "utf-8"));
173
- return pkgData.type === "module";
174
- } catch {
175
- return false;
176
- }
177
- }
178
- const NODE_BUILTIN_NAMESPACE = "node:";
179
- const NPM_BUILTIN_NAMESPACE = "npm:";
180
- const BUN_BUILTIN_NAMESPACE = "bun:";
181
- const nodeBuiltins = import_node_module.builtinModules.filter((id) => !id.includes(":"));
182
- function isBuiltin(id) {
183
- if (process.versions.deno && id.startsWith(NPM_BUILTIN_NAMESPACE))
184
- return true;
185
- if (process.versions.bun && id.startsWith(BUN_BUILTIN_NAMESPACE))
186
- return true;
187
- return isNodeBuiltin(id);
188
- }
189
- function isNodeBuiltin(id) {
190
- if (id.startsWith(NODE_BUILTIN_NAMESPACE))
191
- return true;
192
- return nodeBuiltins.includes(id);
193
- }
194
- // Annotate the CommonJS export names for ESM import in node:
195
- 0 && (module.exports = {
196
- bundleRequire,
197
- isBuiltin,
198
- isFilePathESM,
199
- isNodeBuiltin
200
- });
@@ -1,5 +0,0 @@
1
- export declare function bundleRequire(resolvedPath: string): Promise<any>;
2
- export declare function isFilePathESM(filePath: string): boolean;
3
- export declare function isBuiltin(id: string): boolean;
4
- export declare function isNodeBuiltin(id: string): boolean;
5
- //# sourceMappingURL=bundleRequire.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundleRequire.d.ts","sourceRoot":"","sources":["../src/bundleRequire.ts"],"names":[],"mappings":"AAQA,wBAAsB,aAAa,CAAC,YAAY,EAAE,MAAM,gBAKvD;AAgJD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAevD;AAWD,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAI7C;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAGjD"}
@@ -1,173 +0,0 @@
1
- import { createRequire } from 'node:module';
2
- var require = createRequire(import.meta['url']);
3
-
4
- import path from "path";
5
- import { fileURLToPath } from "url";
6
- var getFilename = () => fileURLToPath(import.meta.url);
7
- var getDirname = () => path.dirname(getFilename());
8
- var __dirname = /* @__PURE__ */ getDirname();
9
- var __filename = /* @__PURE__ */ getFilename();
10
- import fs from "node:fs";
11
- import { builtinModules } from "node:module";
12
- import path2 from "node:path";
13
- import { pathToFileURL } from "node:url";
14
- import { promisify } from "node:util";
15
- import { build } from "esbuild";
16
- const promisifiedRealpath = promisify(fs.realpath);
17
- async function bundleRequire(resolvedPath) {
18
- const isESM = isFilePathESM(resolvedPath);
19
- const bundled = await bundleConfigFile(resolvedPath, isESM);
20
- const userConfig = await loadConfigFromBundledFile(resolvedPath, bundled.code, isESM);
21
- return userConfig;
22
- }
23
- async function bundleConfigFile(fileName, isESM) {
24
- const dirnameVarName = "__injected_original_dirname";
25
- const filenameVarName = "__injected_original_filename";
26
- const importMetaUrlVarName = "__injected_original_import_meta_url";
27
- const result = await build({
28
- absWorkingDir: process.cwd(),
29
- entryPoints: [fileName],
30
- write: false,
31
- target: ["node18"],
32
- platform: "node",
33
- bundle: true,
34
- format: isESM ? "esm" : "cjs",
35
- mainFields: ["main"],
36
- sourcemap: "inline",
37
- metafile: true,
38
- define: {
39
- __dirname: dirnameVarName,
40
- __filename: filenameVarName,
41
- "import.meta.url": importMetaUrlVarName,
42
- "import.meta.dirname": dirnameVarName,
43
- "import.meta.filename": filenameVarName
44
- },
45
- plugins: [
46
- {
47
- name: "externalize-deps",
48
- setup(build2) {
49
- build2.onResolve({ filter: /^[^.].*/ }, async ({ path: id, kind }) => {
50
- if (kind === "entry-point" || path2.isAbsolute(id) || isNodeBuiltin(id)) {
51
- return;
52
- }
53
- if (isBuiltin(id)) {
54
- return { external: true };
55
- }
56
- const isImport = isESM || kind === "dynamic-import";
57
- let idFsPath;
58
- if (!isImport) {
59
- const canResolveWithImport = false;
60
- if (canResolveWithImport) {
61
- throw new Error(
62
- `Failed to resolve ${JSON.stringify(
63
- id
64
- )}. This package is ESM only but it was tried to load by \`require\`.`
65
- );
66
- }
67
- }
68
- if (idFsPath && isImport) {
69
- idFsPath = pathToFileURL(idFsPath).href;
70
- }
71
- if (idFsPath && !isImport && isFilePathESM(idFsPath)) {
72
- throw new Error(
73
- `${JSON.stringify(
74
- id
75
- )} resolved to an ESM file. ESM file cannot be loaded by \`require\`.`
76
- );
77
- }
78
- return {
79
- path: idFsPath,
80
- external: true
81
- };
82
- });
83
- }
84
- },
85
- {
86
- name: "inject-file-scope-variables",
87
- setup(build2) {
88
- build2.onLoad({ filter: /\.[cm]?[jt]s$/ }, async (args) => {
89
- const contents = fs.readFileSync(args.path, "utf-8");
90
- const injectValues = `const ${dirnameVarName} = ${JSON.stringify(path2.dirname(args.path))};const ${filenameVarName} = ${JSON.stringify(args.path)};const ${importMetaUrlVarName} = ${JSON.stringify(pathToFileURL(args.path).href)};`;
91
- return {
92
- loader: args.path.endsWith("ts") ? "ts" : "js",
93
- contents: injectValues + contents
94
- };
95
- });
96
- }
97
- }
98
- ]
99
- });
100
- const { text } = result.outputFiles[0];
101
- return {
102
- code: text,
103
- dependencies: result.metafile ? Object.keys(result.metafile.inputs) : []
104
- };
105
- }
106
- async function loadConfigFromBundledFile(fileName, bundledCode, isESM) {
107
- if (isESM) {
108
- const fileBase = `${fileName}.timestamp-${Date.now()}-${Math.random().toString(16).slice(2)}`;
109
- const fileNameTmp = `${fileBase}.mjs`;
110
- const fileUrl = `${pathToFileURL(fileBase)}.mjs`;
111
- fs.writeFileSync(fileNameTmp, bundledCode);
112
- try {
113
- return (await import(fileUrl)).default;
114
- } finally {
115
- fs.unlink(fileNameTmp, () => {
116
- });
117
- }
118
- } else {
119
- const extension = path2.extname(fileName);
120
- const realFileName = await promisifiedRealpath(fileName);
121
- const loaderExt = extension in require.extensions ? extension : ".js";
122
- const defaultLoader = require.extensions[loaderExt];
123
- require.extensions[loaderExt] = (module, filename) => {
124
- if (filename === realFileName) {
125
- ;
126
- module._compile(bundledCode, filename);
127
- } else {
128
- defaultLoader(module, filename);
129
- }
130
- };
131
- delete require.cache[require.resolve(fileName)];
132
- const raw = require(fileName);
133
- require.extensions[loaderExt] = defaultLoader;
134
- return raw.__esModule ? raw.default : raw;
135
- }
136
- }
137
- function isFilePathESM(filePath) {
138
- if (/\.m[jt]s$/.test(filePath)) {
139
- return true;
140
- }
141
- if (/\.c[jt]s$/.test(filePath)) {
142
- return false;
143
- }
144
- try {
145
- const pkgPath = path2.join(path2.dirname(filePath), "package.json");
146
- const pkgData = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
147
- return pkgData.type === "module";
148
- } catch {
149
- return false;
150
- }
151
- }
152
- const NODE_BUILTIN_NAMESPACE = "node:";
153
- const NPM_BUILTIN_NAMESPACE = "npm:";
154
- const BUN_BUILTIN_NAMESPACE = "bun:";
155
- const nodeBuiltins = builtinModules.filter((id) => !id.includes(":"));
156
- function isBuiltin(id) {
157
- if (process.versions.deno && id.startsWith(NPM_BUILTIN_NAMESPACE))
158
- return true;
159
- if (process.versions.bun && id.startsWith(BUN_BUILTIN_NAMESPACE))
160
- return true;
161
- return isNodeBuiltin(id);
162
- }
163
- function isNodeBuiltin(id) {
164
- if (id.startsWith(NODE_BUILTIN_NAMESPACE))
165
- return true;
166
- return nodeBuiltins.includes(id);
167
- }
168
- export {
169
- bundleRequire,
170
- isBuiltin,
171
- isFilePathESM,
172
- isNodeBuiltin
173
- };