nitro-nightly 3.0.1-20260119-145349-d0c4950f → 3.0.1-20260120-133205-cbfce96c

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 (52) hide show
  1. package/dist/_build/common.mjs +542 -542
  2. package/dist/_build/rolldown.mjs +5 -5
  3. package/dist/_build/rollup.mjs +3 -3
  4. package/dist/_build/vite.build.mjs +1 -1
  5. package/dist/_chunks/dev.mjs +4 -4
  6. package/dist/_chunks/nitro.mjs +3 -3
  7. package/dist/_chunks/nitro2.mjs +1 -1
  8. package/dist/_chunks/utils.mjs +1 -1
  9. package/dist/_libs/@hiogawa/vite-plugin-fullstack.mjs +2 -2
  10. package/dist/_libs/@jridgewell/gen-mapping.mjs +1 -1
  11. package/dist/_libs/@rollup/plugin-commonjs.d.mts +241 -0
  12. package/dist/_libs/@rollup/plugin-commonjs.mjs +19 -19
  13. package/dist/_libs/@rollup/plugin-inject.mjs +1 -1
  14. package/dist/_libs/c12.d.mts +214 -0
  15. package/dist/_libs/c12.mjs +6 -6
  16. package/dist/_libs/chokidar.mjs +2 -2
  17. package/dist/_libs/compatx.d.mts +47 -0
  18. package/dist/_libs/confbox.mjs +2 -2
  19. package/dist/_libs/esbuild.d.mts +20 -0
  20. package/dist/_libs/giget.mjs +1305 -1305
  21. package/dist/_libs/httpxy.d.mts +79 -0
  22. package/dist/_libs/httpxy.mjs +1 -1
  23. package/dist/_libs/magic-string.d.mts +220 -0
  24. package/dist/_libs/mlly.d.mts +57 -0
  25. package/dist/_libs/pkg-types.d.mts +23 -0
  26. package/dist/_libs/rou3.d.mts +43 -0
  27. package/dist/_libs/std-env.d.mts +4 -0
  28. package/dist/_libs/unimport.d.mts +426 -0
  29. package/dist/_libs/unimport.mjs +11 -11
  30. package/dist/_libs/unwasm.d.mts +29 -0
  31. package/dist/_presets.mjs +1 -1
  32. package/dist/builder.mjs +1 -1
  33. package/dist/cli/_chunks/build.mjs +1 -1
  34. package/dist/cli/_chunks/dev.mjs +1 -1
  35. package/dist/cli/_chunks/list.mjs +1 -1
  36. package/dist/cli/_chunks/prepare.mjs +1 -1
  37. package/dist/cli/_chunks/run.mjs +1 -1
  38. package/dist/presets/aws-lambda/runtime/_utils.d.mts +0 -5
  39. package/dist/presets/netlify/runtime/netlify-edge.d.mts +0 -1
  40. package/dist/presets/winterjs/runtime/winterjs.d.mts +0 -1
  41. package/dist/runtime/internal/error/dev.d.mts +0 -1
  42. package/dist/runtime/internal/route-rules.d.mts +0 -4
  43. package/dist/runtime/internal/routes/openapi.d.mts +0 -1
  44. package/dist/runtime/internal/routes/scalar.d.mts +0 -1
  45. package/dist/runtime/internal/routes/swagger.d.mts +0 -1
  46. package/dist/runtime/internal/runtime-config.d.mts +0 -1
  47. package/dist/runtime/nitro.d.mts +0 -3
  48. package/dist/runtime/virtual/renderer-template.d.mts +0 -1
  49. package/dist/types/index.d.mts +962 -1095
  50. package/dist/vite.d.mts +13 -13
  51. package/dist/vite.mjs +10 -9
  52. package/package.json +9 -9
@@ -1,9 +1,9 @@
1
1
  import "../_common.mjs";
2
- import { Ft as relative, Nt as join, _ as writeTypes, a as libChunkName, h as writeBuildInfo, i as getChunkName, n as baseBuildPlugins, o as baseBuildConfig, r as NODE_MODULES_RE } from "./common.mjs";
3
- import { s as debounce } from "../_libs/c12.mjs";
2
+ import { _ as writeTypes, a as libChunkName, at as join, h as writeBuildInfo, i as getChunkName, n as baseBuildPlugins, o as baseBuildConfig, r as NODE_MODULES_RE, st as relative } from "./common.mjs";
3
+ import { i as debounce } from "../_libs/c12.mjs";
4
4
  import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
5
5
  import { n as scanHandlers } from "../_chunks/nitro2.mjs";
6
- import { a as watch$1 } from "../_libs/chokidar.mjs";
6
+ import { n as watch$1 } from "../_libs/chokidar.mjs";
7
7
  import { t as generateFSTree } from "../_chunks/utils.mjs";
8
8
  import { builtinModules } from "node:module";
9
9
  import { watch } from "node:fs";
@@ -52,7 +52,7 @@ const getRolldownConfig = async (nitro) => {
52
52
  format: "esm",
53
53
  entryFileNames: "index.mjs",
54
54
  chunkFileNames: (chunk) => getChunkName(chunk, nitro),
55
- advancedChunks: { groups: [{
55
+ codeSplitting: { groups: [{
56
56
  test: NODE_MODULES_RE,
57
57
  name: (id) => libChunkName(id)
58
58
  }] },
@@ -67,7 +67,7 @@ const getRolldownConfig = async (nitro) => {
67
67
  };
68
68
  config = defu(nitro.options.rollupConfig, config);
69
69
  const outputConfig = config.output;
70
- if (outputConfig.inlineDynamicImports || outputConfig.format === "iife") delete outputConfig.advancedChunks;
70
+ if (outputConfig.inlineDynamicImports || outputConfig.format === "iife") delete outputConfig.codeSplitting;
71
71
  return config;
72
72
  };
73
73
 
@@ -1,9 +1,9 @@
1
1
  import "../_common.mjs";
2
- import { Ft as relative, Mt as isAbsolute, Nt as join, _ as writeTypes, a as libChunkName, h as writeBuildInfo, i as getChunkName, n as baseBuildPlugins, o as baseBuildConfig, r as NODE_MODULES_RE, t as oxc } from "./common.mjs";
3
- import { s as debounce } from "../_libs/c12.mjs";
2
+ import { _ as writeTypes, a as libChunkName, at as join, h as writeBuildInfo, i as getChunkName, it as isAbsolute, n as baseBuildPlugins, o as baseBuildConfig, r as NODE_MODULES_RE, st as relative, t as oxc } from "./common.mjs";
3
+ import { i as debounce } from "../_libs/c12.mjs";
4
4
  import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
5
5
  import { n as scanHandlers } from "../_chunks/nitro2.mjs";
6
- import { a as watch$1 } from "../_libs/chokidar.mjs";
6
+ import { n as watch$1 } from "../_libs/chokidar.mjs";
7
7
  import { t as alias } from "../_libs/@rollup/plugin-alias.mjs";
8
8
  import { t as inject } from "../_libs/@rollup/plugin-inject.mjs";
9
9
  import { t as generateFSTree } from "../_chunks/utils.mjs";
@@ -1,4 +1,4 @@
1
- import { ft as a } from "./common.mjs";
1
+ import { V as a } from "./common.mjs";
2
2
  import { nitro } from "nitro/vite";
3
3
 
4
4
  //#region src/build/vite/build.ts
@@ -1,7 +1,7 @@
1
- import { It as resolve$1, Nt as join$1, dt as T, ft as a, g as writeDevBuildInfo, jt as extname$1, nt as src_default } from "../_build/common.mjs";
2
- import { s as debounce } from "../_libs/c12.mjs";
3
- import { n as createProxyServer } from "../_libs/httpxy.mjs";
4
- import { a as watch$1 } from "../_libs/chokidar.mjs";
1
+ import { B as T, V as a, at as join$1, ct as resolve$1, g as writeDevBuildInfo, j as src_default, rt as extname$1 } from "../_build/common.mjs";
2
+ import { i as debounce } from "../_libs/c12.mjs";
3
+ import { t as createProxyServer } from "../_libs/httpxy.mjs";
4
+ import { n as watch$1 } from "../_libs/chokidar.mjs";
5
5
  import consola$1 from "consola";
6
6
  import { createReadStream, existsSync } from "node:fs";
7
7
  import { readFile, rm, stat as stat$1 } from "node:fs/promises";
@@ -1,5 +1,5 @@
1
- import { Dt as resolveModulePath, Ft as relative, It as resolve, Nt as join, Ot as resolveModuleURL, ct as resolveNitroPath, et as scanUnprefixedPublicAssets, ft as a, lt as writeFile$1, nt as src_default, p as runParallel, pt as d, rt as build, st as prettyPath, tt as compressPublicAssets, vt as findWorkspaceDir } from "../_build/common.mjs";
2
- import { o as watchConfig, r as loadConfig } from "../_libs/c12.mjs";
1
+ import { $ as resolveModulePath, A as compressPublicAssets, H as d, I as prettyPath, L as resolveNitroPath, M as build, R as writeFile$1, V as a, at as join, ct as resolve, et as resolveModuleURL, j as src_default, k as scanUnprefixedPublicAssets, p as runParallel, q as findWorkspaceDir, st as relative } from "../_build/common.mjs";
2
+ import { n as loadConfig, r as watchConfig } from "../_libs/c12.mjs";
3
3
  import { n as resolveCompatibilityDates, r as resolveCompatibilityDatesFromEnv } from "../_libs/compatx.mjs";
4
4
  import { t as klona } from "../_libs/klona.mjs";
5
5
  import { t as escapeStringRegexp } from "../_libs/escape-string-regexp.mjs";
@@ -567,7 +567,7 @@ function isPkgInstalled(pkg, root) {
567
567
  }
568
568
  }
569
569
  async function installPkg(pkg, root) {
570
- const { addDevDependency } = await import("../_libs/giget.mjs").then((n) => n.i);
570
+ const { addDevDependency } = await import("../_libs/giget.mjs").then((n) => n.n);
571
571
  return addDevDependency(pkg, { cwd: root });
572
572
  }
573
573
 
@@ -1,4 +1,4 @@
1
- import { Ft as relative, Nt as join, it as glob } from "../_build/common.mjs";
1
+ import { N as glob, at as join, st as relative } from "../_build/common.mjs";
2
2
  import { withBase, withLeadingSlash, withoutTrailingSlash } from "ufo";
3
3
 
4
4
  //#region src/scan.ts
@@ -1,5 +1,5 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "../_common.mjs";
2
- import { At as dirname, Ft as relative, It as resolve, ft as a, it as glob, p as runParallel } from "../_build/common.mjs";
2
+ import { N as glob, V as a, ct as resolve, nt as dirname, p as runParallel, st as relative } from "../_build/common.mjs";
3
3
  import fs, { promises } from "node:fs";
4
4
  import { promisify } from "node:util";
5
5
  import { colors } from "consola/utils";
@@ -1,5 +1,5 @@
1
1
  import { n as __exportAll } from "../../_common.mjs";
2
- import { K as stripLiteral, q as MagicString } from "../../_build/common.mjs";
2
+ import { S as MagicString, x as stripLiteral } from "../../_build/common.mjs";
3
3
  import fs from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import path from "node:path";
@@ -649,4 +649,4 @@ function mergeAssets(...args) {
649
649
  }
650
650
 
651
651
  //#endregion
652
- export { runtime_exports as n, assetsPlugin as r, mergeAssets as t };
652
+ export { assetsPlugin as n, runtime_exports as t };
@@ -1,4 +1,4 @@
1
- import { J as decode, Y as encode } from "../../_build/common.mjs";
1
+ import { C as decode, w as encode } from "../../_build/common.mjs";
2
2
 
3
3
  //#region node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
4
4
  const schemeRegex = /^[\w+.-]+:\/\//;
@@ -0,0 +1,241 @@
1
+ import { Plugin } from "rollup";
2
+
3
+ //#region node_modules/.pnpm/@rollup+pluginutils@5.3.0_rollup@4.55.2/node_modules/@rollup/pluginutils/types/index.d.ts
4
+ /**
5
+ * A valid `picomatch` glob pattern, or array of patterns.
6
+ */
7
+ type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
8
+ //#endregion
9
+ //#region node_modules/.pnpm/@rollup+plugin-commonjs@29.0.0_rollup@4.55.2/node_modules/@rollup/plugin-commonjs/types/index.d.ts
10
+ type RequireReturnsDefaultOption = boolean | 'auto' | 'preferred' | 'namespace';
11
+ type DefaultIsModuleExportsOption = boolean | 'auto';
12
+ interface RollupCommonJSOptions {
13
+ /**
14
+ * A picomatch pattern, or array of patterns, which specifies the files in
15
+ * the build the plugin should operate on. By default, all files with
16
+ * extension `".cjs"` or those in `extensions` are included, but you can
17
+ * narrow this list by only including specific files. These files will be
18
+ * analyzed and transpiled if either the analysis does not find ES module
19
+ * specific statements or `transformMixedEsModules` is `true`.
20
+ * @default undefined
21
+ */
22
+ include?: FilterPattern;
23
+ /**
24
+ * A picomatch pattern, or array of patterns, which specifies the files in
25
+ * the build the plugin should _ignore_. By default, all files with
26
+ * extensions other than those in `extensions` or `".cjs"` are ignored, but you
27
+ * can exclude additional files. See also the `include` option.
28
+ * @default undefined
29
+ */
30
+ exclude?: FilterPattern;
31
+ /**
32
+ * For extensionless imports, search for extensions other than .js in the
33
+ * order specified. Note that you need to make sure that non-JavaScript files
34
+ * are transpiled by another plugin first.
35
+ * @default [ '.js' ]
36
+ */
37
+ extensions?: ReadonlyArray<string>;
38
+ /**
39
+ * If true then uses of `global` won't be dealt with by this plugin
40
+ * @default false
41
+ */
42
+ ignoreGlobal?: boolean;
43
+ /**
44
+ * If false, skips source map generation for CommonJS modules. This will
45
+ * improve performance.
46
+ * @default true
47
+ */
48
+ sourceMap?: boolean;
49
+ /**
50
+ * Some `require` calls cannot be resolved statically to be translated to
51
+ * imports.
52
+ * When this option is set to `false`, the generated code will either
53
+ * directly throw an error when such a call is encountered or, when
54
+ * `dynamicRequireTargets` is used, when such a call cannot be resolved with a
55
+ * configured dynamic require target.
56
+ * Setting this option to `true` will instead leave the `require` call in the
57
+ * code or use it as a fallback for `dynamicRequireTargets`.
58
+ * @default false
59
+ */
60
+ ignoreDynamicRequires?: boolean;
61
+ /**
62
+ * Instructs the plugin whether to enable mixed module transformations. This
63
+ * is useful in scenarios with modules that contain a mix of ES `import`
64
+ * statements and CommonJS `require` expressions. Set to `true` if `require`
65
+ * calls should be transformed to imports in mixed modules, or `false` if the
66
+ * `require` expressions should survive the transformation. The latter can be
67
+ * important if the code contains environment detection, or you are coding
68
+ * for an environment with special treatment for `require` calls such as
69
+ * ElectronJS. See also the `ignore` option.
70
+ * @default false
71
+ */
72
+ transformMixedEsModules?: boolean;
73
+ /**
74
+ * By default, this plugin will try to hoist `require` statements as imports
75
+ * to the top of each file. While this works well for many code bases and
76
+ * allows for very efficient ESM output, it does not perfectly capture
77
+ * CommonJS semantics as the order of side effects like log statements may
78
+ * change. But it is especially problematic when there are circular `require`
79
+ * calls between CommonJS modules as those often rely on the lazy execution of
80
+ * nested `require` calls.
81
+ *
82
+ * Setting this option to `true` will wrap all CommonJS files in functions
83
+ * which are executed when they are required for the first time, preserving
84
+ * NodeJS semantics. Note that this can have an impact on the size and
85
+ * performance of the generated code.
86
+ *
87
+ * The default value of `"auto"` will only wrap CommonJS files when they are
88
+ * part of a CommonJS dependency cycle, e.g. an index file that is required by
89
+ * many of its dependencies. All other CommonJS files are hoisted. This is the
90
+ * recommended setting for most code bases.
91
+ *
92
+ * `false` will entirely prevent wrapping and hoist all files. This may still
93
+ * work depending on the nature of cyclic dependencies but will often cause
94
+ * problems.
95
+ *
96
+ * You can also provide a picomatch pattern, or array of patterns, to only
97
+ * specify a subset of files which should be wrapped in functions for proper
98
+ * `require` semantics.
99
+ *
100
+ * `"debug"` works like `"auto"` but after bundling, it will display a warning
101
+ * containing a list of ids that have been wrapped which can be used as
102
+ * picomatch pattern for fine-tuning.
103
+ * @default "auto"
104
+ */
105
+ strictRequires?: boolean | FilterPattern;
106
+ /**
107
+ * Sometimes you have to leave require statements unconverted. Pass an array
108
+ * containing the IDs or a `id => boolean` function.
109
+ * @default []
110
+ */
111
+ ignore?: ReadonlyArray<string> | ((id: string) => boolean);
112
+ /**
113
+ * In most cases, where `require` calls are inside a `try-catch` clause,
114
+ * they should be left unconverted as it requires an optional dependency
115
+ * that may or may not be installed beside the rolled up package.
116
+ * Due to the conversion of `require` to a static `import` - the call is
117
+ * hoisted to the top of the file, outside the `try-catch` clause.
118
+ *
119
+ * - `true`: Default. All `require` calls inside a `try` will be left unconverted.
120
+ * - `false`: All `require` calls inside a `try` will be converted as if the
121
+ * `try-catch` clause is not there.
122
+ * - `remove`: Remove all `require` calls from inside any `try` block.
123
+ * - `string[]`: Pass an array containing the IDs to left unconverted.
124
+ * - `((id: string) => boolean|'remove')`: Pass a function that controls
125
+ * individual IDs.
126
+ *
127
+ * @default true
128
+ */
129
+ ignoreTryCatch?: boolean | 'remove' | ReadonlyArray<string> | ((id: string) => boolean | 'remove');
130
+ /**
131
+ * Controls how to render imports from external dependencies. By default,
132
+ * this plugin assumes that all external dependencies are CommonJS. This
133
+ * means they are rendered as default imports to be compatible with e.g.
134
+ * NodeJS where ES modules can only import a default export from a CommonJS
135
+ * dependency.
136
+ *
137
+ * If you set `esmExternals` to `true`, this plugin assumes that all
138
+ * external dependencies are ES modules and respect the
139
+ * `requireReturnsDefault` option. If that option is not set, they will be
140
+ * rendered as namespace imports.
141
+ *
142
+ * You can also supply an array of ids to be treated as ES modules, or a
143
+ * function that will be passed each external id to determine whether it is
144
+ * an ES module.
145
+ * @default false
146
+ */
147
+ esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean);
148
+ /**
149
+ * Controls what is returned when requiring an ES module from a CommonJS file.
150
+ * When using the `esmExternals` option, this will also apply to external
151
+ * modules. By default, this plugin will render those imports as namespace
152
+ * imports i.e.
153
+ *
154
+ * ```js
155
+ * // input
156
+ * const foo = require('foo');
157
+ *
158
+ * // output
159
+ * import * as foo from 'foo';
160
+ * ```
161
+ *
162
+ * However, there are some situations where this may not be desired.
163
+ * For these situations, you can change Rollup's behaviour either globally or
164
+ * per module. To change it globally, set the `requireReturnsDefault` option
165
+ * to one of the following values:
166
+ *
167
+ * - `false`: This is the default, requiring an ES module returns its
168
+ * namespace. This is the only option that will also add a marker
169
+ * `__esModule: true` to the namespace to support interop patterns in
170
+ * CommonJS modules that are transpiled ES modules.
171
+ * - `"namespace"`: Like `false`, requiring an ES module returns its
172
+ * namespace, but the plugin does not add the `__esModule` marker and thus
173
+ * creates more efficient code. For external dependencies when using
174
+ * `esmExternals: true`, no additional interop code is generated.
175
+ * - `"auto"`: This is complementary to how `output.exports: "auto"` works in
176
+ * Rollup: If a module has a default export and no named exports, requiring
177
+ * that module returns the default export. In all other cases, the namespace
178
+ * is returned. For external dependencies when using `esmExternals: true`, a
179
+ * corresponding interop helper is added.
180
+ * - `"preferred"`: If a module has a default export, requiring that module
181
+ * always returns the default export, no matter whether additional named
182
+ * exports exist. This is similar to how previous versions of this plugin
183
+ * worked. Again for external dependencies when using `esmExternals: true`,
184
+ * an interop helper is added.
185
+ * - `true`: This will always try to return the default export on require
186
+ * without checking if it actually exists. This can throw at build time if
187
+ * there is no default export. This is how external dependencies are handled
188
+ * when `esmExternals` is not used. The advantage over the other options is
189
+ * that, like `false`, this does not add an interop helper for external
190
+ * dependencies, keeping the code lean.
191
+ *
192
+ * To change this for individual modules, you can supply a function for
193
+ * `requireReturnsDefault` instead. This function will then be called once for
194
+ * each required ES module or external dependency with the corresponding id
195
+ * and allows you to return different values for different modules.
196
+ * @default false
197
+ */
198
+ requireReturnsDefault?: RequireReturnsDefaultOption | ((id: string) => RequireReturnsDefaultOption);
199
+ /**
200
+ * @default "auto"
201
+ */
202
+ defaultIsModuleExports?: DefaultIsModuleExportsOption | ((id: string) => DefaultIsModuleExportsOption);
203
+ /**
204
+ * Some modules contain dynamic `require` calls, or require modules that
205
+ * contain circular dependencies, which are not handled well by static
206
+ * imports. Including those modules as `dynamicRequireTargets` will simulate a
207
+ * CommonJS (NodeJS-like) environment for them with support for dynamic
208
+ * dependencies. It also enables `strictRequires` for those modules.
209
+ *
210
+ * Note: In extreme cases, this feature may result in some paths being
211
+ * rendered as absolute in the final bundle. The plugin tries to avoid
212
+ * exposing paths from the local machine, but if you are `dynamicRequirePaths`
213
+ * with paths that are far away from your project's folder, that may require
214
+ * replacing strings like `"/Users/John/Desktop/foo-project/"` -> `"/"`.
215
+ */
216
+ dynamicRequireTargets?: string | ReadonlyArray<string>;
217
+ /**
218
+ * To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
219
+ * that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
220
+ * may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
221
+ * home directory name. By default, it uses the current working directory.
222
+ */
223
+ dynamicRequireRoot?: string;
224
+ /**
225
+ * When enabled, external Node built-ins (e.g., `node:fs`) required from wrapped CommonJS modules
226
+ * will use `createRequire(import.meta.url)` instead of being hoisted as ESM imports. This prevents
227
+ * eager loading of Node built-ins at module initialization time.
228
+ *
229
+ * Note: This option adds a dependency on `node:module` in the output, which may not be available
230
+ * in some environments like edge runtimes (Cloudflare Workers, Vercel Edge Runtime).
231
+ *
232
+ * @default false
233
+ */
234
+ requireNodeBuiltins?: boolean;
235
+ }
236
+ /**
237
+ * Convert CommonJS modules to ES6, so they can be included in a Rollup bundle
238
+ */
239
+ declare function commonjs(options?: RollupCommonJSOptions): Plugin;
240
+ //#endregion
241
+ export { commonjs as t };
@@ -1,5 +1,5 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "../../_common.mjs";
2
- import { c as createFilter, d as makeLegalIdentifier, f as walk, ot as Builder, q as MagicString, s as attachScopes, u as extractAssignedNames } from "../../_build/common.mjs";
2
+ import { F as Builder, S as MagicString, c as createFilter, d as makeLegalIdentifier, f as walk, s as attachScopes, u as extractAssignedNames } from "../../_build/common.mjs";
3
3
  import { existsSync, readFileSync, statSync } from "fs";
4
4
  import { basename, dirname, extname, join, relative, resolve, sep } from "path";
5
5
 
@@ -493,8 +493,8 @@ function getRequireResolver(extensions, detectCyclesAndConditional, currentlyRes
493
493
  };
494
494
  const getTypeForImportedModule = async (resolved, loadModule) => {
495
495
  if (resolved.id in knownCjsModuleTypes) return knownCjsModuleTypes[resolved.id];
496
- const { meta: { commonjs: commonjs$1 } } = await loadModule(resolved);
497
- return commonjs$1 && commonjs$1.isCommonJS || false;
496
+ const { meta: { commonjs } } = await loadModule(resolved);
497
+ return commonjs && commonjs.isCommonJS || false;
498
498
  };
499
499
  return {
500
500
  getWrappedIds: () => Object.keys(knownCjsModuleTypes).filter((id) => knownCjsModuleTypes[id] === IS_WRAPPED_COMMONJS),
@@ -693,23 +693,23 @@ function wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRan
693
693
  magicString.trim().indent(" ", { exclude: indentExclusionRanges }).prepend(`(function (${args.join(", ")}) {\n`).append(` \n} (${passedArgs.join(", ")}));`);
694
694
  }
695
695
  function rewriteExportsAndGetExportsBlock(magicString, moduleName, exportsName, exportedExportsName, wrapped, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsAssignmentsByName, topLevelAssignments, defineCompiledEsmExpressions, deconflictedExportNames, code, HELPERS_NAME, exportMode, defaultIsModuleExports, usesRequireWrapper, requireName) {
696
- const exports$1 = [];
696
+ const exports = [];
697
697
  const exportDeclarations = [];
698
- if (usesRequireWrapper) getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exports$1, moduleExportsAssignments, exportsAssignmentsByName, moduleName, exportsName, requireName, defineCompiledEsmExpressions);
699
- else if (exportMode === "replace") getExportsForReplacedModuleExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsName, defaultIsModuleExports, HELPERS_NAME);
698
+ if (usesRequireWrapper) getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exports, moduleExportsAssignments, exportsAssignmentsByName, moduleName, exportsName, requireName, defineCompiledEsmExpressions);
699
+ else if (exportMode === "replace") getExportsForReplacedModuleExports(magicString, exports, exportDeclarations, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsName, defaultIsModuleExports, HELPERS_NAME);
700
700
  else {
701
701
  if (exportMode === "module") {
702
702
  exportDeclarations.push(`var ${exportedExportsName} = ${moduleName}.exports`);
703
- exports$1.push(`${exportedExportsName} as __moduleExports`);
704
- } else exports$1.push(`${exportsName} as __moduleExports`);
703
+ exports.push(`${exportedExportsName} as __moduleExports`);
704
+ } else exports.push(`${exportsName} as __moduleExports`);
705
705
  if (wrapped) exportDeclarations.push(getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME));
706
- else getExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, exportsAssignmentsByName, deconflictedExportNames, topLevelAssignments, moduleName, exportsName, exportedExportsName, defineCompiledEsmExpressions, HELPERS_NAME, defaultIsModuleExports, exportMode);
706
+ else getExports(magicString, exports, exportDeclarations, moduleExportsAssignments, exportsAssignmentsByName, deconflictedExportNames, topLevelAssignments, moduleName, exportsName, exportedExportsName, defineCompiledEsmExpressions, HELPERS_NAME, defaultIsModuleExports, exportMode);
707
707
  }
708
- if (exports$1.length) exportDeclarations.push(`export { ${exports$1.join(", ")} }`);
708
+ if (exports.length) exportDeclarations.push(`export { ${exports.join(", ")} }`);
709
709
  return `\n\n${exportDeclarations.join(";\n")};`;
710
710
  }
711
- function getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exports$1, moduleExportsAssignments, exportsAssignmentsByName, moduleName, exportsName, requireName, defineCompiledEsmExpressions) {
712
- exports$1.push(`${requireName} as __require`);
711
+ function getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exports, moduleExportsAssignments, exportsAssignmentsByName, moduleName, exportsName, requireName, defineCompiledEsmExpressions) {
712
+ exports.push(`${requireName} as __require`);
713
713
  if (wrapped) return;
714
714
  if (exportMode === "replace") rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName);
715
715
  else {
@@ -718,16 +718,16 @@ function getExportsWhenUsingRequireWrapper(magicString, wrapped, exportMode, exp
718
718
  replaceDefineCompiledEsmExpressionsAndGetIfRestorable(defineCompiledEsmExpressions, magicString, exportMode, moduleName, exportsName);
719
719
  }
720
720
  }
721
- function getExportsForReplacedModuleExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsName, defaultIsModuleExports, HELPERS_NAME) {
721
+ function getExportsForReplacedModuleExports(magicString, exports, exportDeclarations, moduleExportsAssignments, firstTopLevelModuleExportsAssignment, exportsName, defaultIsModuleExports, HELPERS_NAME) {
722
722
  for (const { left } of moduleExportsAssignments) magicString.overwrite(left.start, left.end, exportsName);
723
723
  magicString.prependRight(firstTopLevelModuleExportsAssignment.left.start, "var ");
724
- exports$1.push(`${exportsName} as __moduleExports`);
724
+ exports.push(`${exportsName} as __moduleExports`);
725
725
  exportDeclarations.push(getDefaultExportDeclaration(exportsName, defaultIsModuleExports, HELPERS_NAME));
726
726
  }
727
727
  function getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) {
728
728
  return `export default ${defaultIsModuleExports === true ? exportedExportsName : defaultIsModuleExports === false ? `${exportedExportsName}.default` : `/*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportedExportsName})`}`;
729
729
  }
730
- function getExports(magicString, exports$1, exportDeclarations, moduleExportsAssignments, exportsAssignmentsByName, deconflictedExportNames, topLevelAssignments, moduleName, exportsName, exportedExportsName, defineCompiledEsmExpressions, HELPERS_NAME, defaultIsModuleExports, exportMode) {
730
+ function getExports(magicString, exports, exportDeclarations, moduleExportsAssignments, exportsAssignmentsByName, deconflictedExportNames, topLevelAssignments, moduleName, exportsName, exportedExportsName, defineCompiledEsmExpressions, HELPERS_NAME, defaultIsModuleExports, exportMode) {
731
731
  let deconflictedDefaultExportName;
732
732
  for (const { left } of moduleExportsAssignments) magicString.overwrite(left.start, left.end, `${moduleName}.exports`);
733
733
  for (const [exportName, { nodes }] of exportsAssignmentsByName) {
@@ -743,11 +743,11 @@ function getExports(magicString, exports$1, exportDeclarations, moduleExportsAss
743
743
  }
744
744
  if (needsDeclaration) magicString.prepend(`var ${deconflicted};\n`);
745
745
  if (exportName === "default") deconflictedDefaultExportName = deconflicted;
746
- else exports$1.push(exportName === deconflicted ? exportName : `${deconflicted} as ${exportName}`);
746
+ else exports.push(exportName === deconflicted ? exportName : `${deconflicted} as ${exportName}`);
747
747
  }
748
748
  const isRestorableCompiledEsm = replaceDefineCompiledEsmExpressionsAndGetIfRestorable(defineCompiledEsmExpressions, magicString, exportMode, moduleName, exportsName);
749
- if (defaultIsModuleExports === false || defaultIsModuleExports === "auto" && isRestorableCompiledEsm && moduleExportsAssignments.length === 0) exports$1.push(`${deconflictedDefaultExportName || exportedExportsName} as default`);
750
- else if (defaultIsModuleExports === true || !isRestorableCompiledEsm && moduleExportsAssignments.length === 0) exports$1.push(`${exportedExportsName} as default`);
749
+ if (defaultIsModuleExports === false || defaultIsModuleExports === "auto" && isRestorableCompiledEsm && moduleExportsAssignments.length === 0) exports.push(`${deconflictedDefaultExportName || exportedExportsName} as default`);
750
+ else if (defaultIsModuleExports === true || !isRestorableCompiledEsm && moduleExportsAssignments.length === 0) exports.push(`${exportedExportsName} as default`);
751
751
  else exportDeclarations.push(getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME));
752
752
  }
753
753
  function rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName) {
@@ -811,7 +811,7 @@ function getRequireHandlers() {
811
811
  processRequireExpressions(imports, await resolveRequireSourcesAndUpdateMeta(id, needsRequireWrapper ? IS_WRAPPED_COMMONJS : !isEsModule, commonjsMeta, Object.keys(requiresBySource).map((source) => {
812
812
  return {
813
813
  source,
814
- isConditional: requiresBySource[source].every((require$1) => require$1.isInsideConditional)
814
+ isConditional: requiresBySource[source].every((require) => require.isInsideConditional)
815
815
  };
816
816
  })), requiresBySource, getIgnoreTryCatchRequireStatementMode, magicString);
817
817
  return imports.length ? `${imports.join(";\n")};\n\n` : "";
@@ -1,4 +1,4 @@
1
- import { c as createFilter, d as makeLegalIdentifier, f as walk, q as MagicString, s as attachScopes } from "../../_build/common.mjs";
1
+ import { S as MagicString, c as createFilter, d as makeLegalIdentifier, f as walk, s as attachScopes } from "../../_build/common.mjs";
2
2
  import { sep } from "path";
3
3
 
4
4
  //#region node_modules/.pnpm/@rollup+plugin-inject@5.0.5_rollup@4.55.2/node_modules/@rollup/plugin-inject/dist/es/index.js