nitro-nightly 3.0.1-20251210-155254-4d2e6b8a → 3.0.1-20251210-204845-4fbfed70
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/_build/rolldown.mjs +13 -5
- package/dist/_build/rollup.mjs +10 -6
- package/dist/_build/shared3.mjs +12 -11
- package/dist/_build/vite.plugin.mjs +10 -19
- package/dist/_libs/local-pkg.mjs +1 -8
- package/package.json +1 -1
package/dist/_build/rolldown.mjs
CHANGED
|
@@ -3,7 +3,6 @@ import { O as relative, o as debounce, w as join } from "../_libs/c12.mjs";
|
|
|
3
3
|
import "../_libs/@jridgewell/gen-mapping.mjs";
|
|
4
4
|
import "../_libs/@pi0/vite-plugin-fullstack.mjs";
|
|
5
5
|
import "../_libs/acorn.mjs";
|
|
6
|
-
import { d as sanitizeFilePath } from "../_libs/local-pkg.mjs";
|
|
7
6
|
import "../_libs/unimport.mjs";
|
|
8
7
|
import "../_libs/@rollup/plugin-commonjs.mjs";
|
|
9
8
|
import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
|
|
@@ -12,7 +11,7 @@ import { i as scanHandlers, n as writeTypes } from "../_nitro2.mjs";
|
|
|
12
11
|
import "../_libs/mime.mjs";
|
|
13
12
|
import { n as writeBuildInfo } from "./shared2.mjs";
|
|
14
13
|
import { a as watch$1 } from "../_libs/chokidar.mjs";
|
|
15
|
-
import { n as
|
|
14
|
+
import { a as baseBuildConfig, i as libChunkName, n as NODE_MODULES_RE, r as getChunkName, t as baseBuildPlugins } from "./shared3.mjs";
|
|
16
15
|
import "../_libs/etag.mjs";
|
|
17
16
|
import "../_libs/@jridgewell/remapping.mjs";
|
|
18
17
|
import "../_libs/@rollup/plugin-replace.mjs";
|
|
@@ -54,7 +53,11 @@ const getRolldownConfig = (nitro) => {
|
|
|
54
53
|
}
|
|
55
54
|
},
|
|
56
55
|
onwarn(warning, warn) {
|
|
57
|
-
if (![
|
|
56
|
+
if (![
|
|
57
|
+
"CIRCULAR_DEPENDENCY",
|
|
58
|
+
"EVAL",
|
|
59
|
+
"EMPTY_CHUNK"
|
|
60
|
+
].includes(warning.code || "") && !warning.message.includes("Unsupported source map comment")) warn(warning);
|
|
58
61
|
},
|
|
59
62
|
treeshake: { moduleSideEffects(id) {
|
|
60
63
|
return nitro.options.moduleSideEffects.some((p) => id.startsWith(p));
|
|
@@ -62,11 +65,14 @@ const getRolldownConfig = (nitro) => {
|
|
|
62
65
|
output: {
|
|
63
66
|
format: "esm",
|
|
64
67
|
entryFileNames: "index.mjs",
|
|
65
|
-
chunkFileNames: (chunk) => getChunkName(
|
|
68
|
+
chunkFileNames: (chunk) => getChunkName(chunk, nitro),
|
|
69
|
+
advancedChunks: { groups: [{
|
|
70
|
+
test: NODE_MODULES_RE,
|
|
71
|
+
name: (id) => libChunkName(id)
|
|
72
|
+
}] },
|
|
66
73
|
dir: nitro.options.output.serverDir,
|
|
67
74
|
inlineDynamicImports: nitro.options.inlineDynamicImports,
|
|
68
75
|
minify: nitro.options.minify,
|
|
69
|
-
sanitizeFileName: sanitizeFilePath,
|
|
70
76
|
sourcemap: nitro.options.sourcemap,
|
|
71
77
|
sourcemapIgnoreList(relativePath) {
|
|
72
78
|
return relativePath.includes("node_modules");
|
|
@@ -74,6 +80,8 @@ const getRolldownConfig = (nitro) => {
|
|
|
74
80
|
}
|
|
75
81
|
};
|
|
76
82
|
config = defu(nitro.options.rollupConfig, config);
|
|
83
|
+
const outputConfig = config.output;
|
|
84
|
+
if (outputConfig.inlineDynamicImports || outputConfig.format === "iife") delete outputConfig.advancedChunks;
|
|
77
85
|
return config;
|
|
78
86
|
};
|
|
79
87
|
|
package/dist/_build/rollup.mjs
CHANGED
|
@@ -3,7 +3,6 @@ import { C as isAbsolute, O as relative, o as debounce, w as join } from "../_li
|
|
|
3
3
|
import "../_libs/@jridgewell/gen-mapping.mjs";
|
|
4
4
|
import "../_libs/@pi0/vite-plugin-fullstack.mjs";
|
|
5
5
|
import "../_libs/acorn.mjs";
|
|
6
|
-
import { d as sanitizeFilePath } from "../_libs/local-pkg.mjs";
|
|
7
6
|
import "../_libs/unimport.mjs";
|
|
8
7
|
import { t as commonjs } from "../_libs/@rollup/plugin-commonjs.mjs";
|
|
9
8
|
import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
|
|
@@ -14,7 +13,7 @@ import { n as writeBuildInfo } from "./shared2.mjs";
|
|
|
14
13
|
import { a as watch$1 } from "../_libs/chokidar.mjs";
|
|
15
14
|
import { t as alias } from "../_libs/@rollup/plugin-alias.mjs";
|
|
16
15
|
import { t as inject } from "../_libs/@rollup/plugin-inject.mjs";
|
|
17
|
-
import { n as
|
|
16
|
+
import { a as baseBuildConfig, i as libChunkName, n as NODE_MODULES_RE, r as getChunkName, t as baseBuildPlugins } from "./shared3.mjs";
|
|
18
17
|
import "../_libs/etag.mjs";
|
|
19
18
|
import "../_libs/@jridgewell/remapping.mjs";
|
|
20
19
|
import "../_libs/@rollup/plugin-replace.mjs";
|
|
@@ -94,7 +93,8 @@ const getRollupConfig = (nitro) => {
|
|
|
94
93
|
if (![
|
|
95
94
|
"EVAL",
|
|
96
95
|
"CIRCULAR_DEPENDENCY",
|
|
97
|
-
"THIS_IS_UNDEFINED"
|
|
96
|
+
"THIS_IS_UNDEFINED",
|
|
97
|
+
"EMPTY_CHUNK"
|
|
98
98
|
].includes(warning.code || "") && !warning.message.includes("Unsupported source map comment")) rollupWarn(warning);
|
|
99
99
|
},
|
|
100
100
|
treeshake: { moduleSideEffects(id) {
|
|
@@ -103,17 +103,21 @@ const getRollupConfig = (nitro) => {
|
|
|
103
103
|
output: {
|
|
104
104
|
format: "esm",
|
|
105
105
|
entryFileNames: "index.mjs",
|
|
106
|
-
chunkFileNames: (chunk) => getChunkName(
|
|
106
|
+
chunkFileNames: (chunk) => getChunkName(chunk, nitro),
|
|
107
107
|
dir: nitro.options.output.serverDir,
|
|
108
108
|
inlineDynamicImports: nitro.options.inlineDynamicImports,
|
|
109
109
|
generatedCode: { constBindings: true },
|
|
110
|
-
sanitizeFileName: sanitizeFilePath,
|
|
111
110
|
sourcemap: nitro.options.sourcemap,
|
|
112
111
|
sourcemapExcludeSources: true,
|
|
113
|
-
sourcemapIgnoreList: (id) => id.includes("node_modules")
|
|
112
|
+
sourcemapIgnoreList: (id) => id.includes("node_modules"),
|
|
113
|
+
manualChunks(id) {
|
|
114
|
+
if (NODE_MODULES_RE.test(id)) return libChunkName(id);
|
|
115
|
+
}
|
|
114
116
|
}
|
|
115
117
|
};
|
|
116
118
|
config = defu(nitro.options.rollupConfig, config);
|
|
119
|
+
const outputConfig = config.output;
|
|
120
|
+
if (outputConfig.inlineDynamicImports || outputConfig.format === "iife") delete outputConfig.manualChunks;
|
|
117
121
|
return config;
|
|
118
122
|
};
|
|
119
123
|
|
package/dist/_build/shared3.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { i as __toESM } from "../_rolldown.mjs";
|
|
2
2
|
import { C as isAbsolute, O as relative, T as normalize, h as resolveModulePath, k as resolve, w as join } from "../_libs/c12.mjs";
|
|
3
|
-
import { s as parseNodeModulePath } from "../_libs/local-pkg.mjs";
|
|
4
3
|
import { i as unplugin } from "../_libs/unimport.mjs";
|
|
5
4
|
import { t as glob } from "../_libs/tinyglobby.mjs";
|
|
6
5
|
import { i as a, r as T, t as A } from "../_libs/std-env.mjs";
|
|
@@ -111,10 +110,17 @@ function resolveAliases(_aliases) {
|
|
|
111
110
|
//#endregion
|
|
112
111
|
//#region src/build/chunks.ts
|
|
113
112
|
const virtualRe = /^\0|^virtual:/;
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
const NODE_MODULES_RE$1 = /node_modules[/\\][^.]/;
|
|
114
|
+
function libChunkName(id) {
|
|
115
|
+
return `_libs/${id.match(/.*(?:[/\\])node_modules(?:[/\\])(?<package>@[^/\\]+[/\\][^/\\]+|[^/\\.][^/\\]*)/)?.groups?.package || "common"}`;
|
|
116
|
+
}
|
|
117
|
+
function getChunkName(chunk, nitro) {
|
|
118
|
+
if (chunk.name.startsWith("_libs/")) return `${chunk.name}.mjs`;
|
|
119
|
+
if (chunk.name === "rolldown-runtime") return "_runtime/rolldown.mjs";
|
|
120
|
+
if (chunk.moduleIds.length === 0) return `_chunks/${chunk.name}.mjs`;
|
|
121
|
+
const ids = chunk.moduleIds.filter((id) => !virtualRe.test(id));
|
|
116
122
|
if (ids.length === 0) {
|
|
117
|
-
if (moduleIds.every((id) => id.includes("virtual:raw"))) return `_raw/[name].mjs`;
|
|
123
|
+
if (chunk.moduleIds.every((id) => id.includes("virtual:raw"))) return `_raw/[name].mjs`;
|
|
118
124
|
return `_virtual/[name].mjs`;
|
|
119
125
|
}
|
|
120
126
|
if (ids.every((id) => id.endsWith(".wasm"))) return `_wasm/[name].mjs`;
|
|
@@ -127,12 +133,7 @@ function getChunkName(nitro, moduleIds) {
|
|
|
127
133
|
if (routeHandler?.route) return `_routes/${routeToFsPath(routeHandler.route)}.mjs`;
|
|
128
134
|
if (Object.entries(nitro.options.tasks).find(([_, task]) => task.handler === mainId)) return `_tasks/[name].mjs`;
|
|
129
135
|
}
|
|
130
|
-
|
|
131
|
-
if (ids.length > 3) return `_lib/[hash].mjs`;
|
|
132
|
-
const pkgNames = [...new Set(ids.map((id) => parseNodeModulePath(id)?.name?.replace(/^@.+\//, "")).filter((id) => id && !id.startsWith(".")).sort())].join("+");
|
|
133
|
-
return `_lib/${pkgNames.length < 50 ? pkgNames : "[hash]"}.mjs`;
|
|
134
|
-
}
|
|
135
|
-
return `_/[hash].mjs`;
|
|
136
|
+
return `_chunks/[name].mjs`;
|
|
136
137
|
}
|
|
137
138
|
function routeToFsPath(route) {
|
|
138
139
|
return route.split("/").slice(1).map((s) => `${s.replace(/[:*]+/g, "$").replace(/[^$a-zA-Z0-9_.[\]/]/g, "_")}`).join("/") || "index";
|
|
@@ -1107,4 +1108,4 @@ function baseBuildPlugins(nitro, base) {
|
|
|
1107
1108
|
}
|
|
1108
1109
|
|
|
1109
1110
|
//#endregion
|
|
1110
|
-
export {
|
|
1111
|
+
export { baseBuildConfig as a, libChunkName as i, NODE_MODULES_RE$1 as n, getChunkName as r, baseBuildPlugins as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { C as isAbsolute$1, O as relative$1, b as basename$1, h as resolveModulePath, k as resolve$1, o as debounce, w as join$1, x as dirname$1 } from "../_libs/c12.mjs";
|
|
2
2
|
import { t as assetsPlugin } from "../_libs/@pi0/vite-plugin-fullstack.mjs";
|
|
3
|
-
import { d as sanitizeFilePath } from "../_libs/local-pkg.mjs";
|
|
4
3
|
import { t as formatCompatibilityDate } from "../_libs/compatx.mjs";
|
|
5
4
|
import { i as a, r as T } from "../_libs/std-env.mjs";
|
|
6
5
|
import { a as copyPublicAssets, i as prepare, s as createNitro } from "../_nitro.mjs";
|
|
@@ -11,7 +10,7 @@ import { i as NodeEnvRunner, r as NitroDevApp } from "../_dev.mjs";
|
|
|
11
10
|
import { a as watch$1 } from "../_libs/chokidar.mjs";
|
|
12
11
|
import { t as alias } from "../_libs/@rollup/plugin-alias.mjs";
|
|
13
12
|
import { t as inject } from "../_libs/@rollup/plugin-inject.mjs";
|
|
14
|
-
import { n as
|
|
13
|
+
import { a as baseBuildConfig, i as libChunkName, n as NODE_MODULES_RE, r as getChunkName, t as baseBuildPlugins } from "./shared3.mjs";
|
|
15
14
|
import consola$1 from "consola";
|
|
16
15
|
import { join, resolve } from "node:path";
|
|
17
16
|
import { existsSync, watch } from "node:fs";
|
|
@@ -24,19 +23,6 @@ import { DevEnvironment } from "vite";
|
|
|
24
23
|
import { spawn } from "node:child_process";
|
|
25
24
|
|
|
26
25
|
//#region src/build/vite/rollup.ts
|
|
27
|
-
/**
|
|
28
|
-
* Removed from base rollup config:
|
|
29
|
-
* - nodeResolve
|
|
30
|
-
* - commonjs
|
|
31
|
-
* - esbuild
|
|
32
|
-
* - sourcemapMinify
|
|
33
|
-
* - json
|
|
34
|
-
* - raw
|
|
35
|
-
*
|
|
36
|
-
* TODO: Reuse with rollup:
|
|
37
|
-
* - chunkFileNames
|
|
38
|
-
* - moduleSideEffects
|
|
39
|
-
*/
|
|
40
26
|
const getViteRollupConfig = (ctx) => {
|
|
41
27
|
const nitro$1 = ctx.nitro;
|
|
42
28
|
const base = baseBuildConfig(nitro$1);
|
|
@@ -56,11 +42,16 @@ const getViteRollupConfig = (ctx) => {
|
|
|
56
42
|
output: {
|
|
57
43
|
format: "esm",
|
|
58
44
|
entryFileNames: "index.mjs",
|
|
59
|
-
chunkFileNames: (chunk) => getChunkName(nitro$1
|
|
45
|
+
chunkFileNames: (chunk) => getChunkName(chunk, nitro$1),
|
|
46
|
+
...ctx._isRolldown ? { advancedChunks: { groups: [{
|
|
47
|
+
test: NODE_MODULES_RE,
|
|
48
|
+
name: (id) => libChunkName(id)
|
|
49
|
+
}] } } : { manualChunks(id) {
|
|
50
|
+
if (NODE_MODULES_RE.test(id)) return libChunkName(id);
|
|
51
|
+
} },
|
|
60
52
|
inlineDynamicImports: nitro$1.options.inlineDynamicImports,
|
|
61
53
|
dir: nitro$1.options.output.serverDir,
|
|
62
54
|
generatedCode: { ...ctx._isRolldown ? {} : { constBindings: true } },
|
|
63
|
-
sanitizeFileName: sanitizeFilePath,
|
|
64
55
|
...ctx._isRolldown ? {} : { sourcemapExcludeSources: true },
|
|
65
56
|
sourcemapIgnoreList: (id) => id.includes("node_modules")
|
|
66
57
|
}
|
|
@@ -356,7 +347,7 @@ function createNitroEnvironment(ctx) {
|
|
|
356
347
|
minify: ctx.nitro.options.minify,
|
|
357
348
|
emptyOutDir: false,
|
|
358
349
|
sourcemap: ctx.nitro.options.sourcemap,
|
|
359
|
-
commonjsOptions:
|
|
350
|
+
commonjsOptions: ctx.nitro.options.commonJS
|
|
360
351
|
},
|
|
361
352
|
resolve: {
|
|
362
353
|
noExternal: ctx.nitro.options.dev ? [
|
|
@@ -367,6 +358,7 @@ function createNitroEnvironment(ctx) {
|
|
|
367
358
|
conditions: ctx.nitro.options.exportConditions,
|
|
368
359
|
externalConditions: ctx.nitro.options.exportConditions?.filter((c) => !/browser|wasm/.test(c))
|
|
369
360
|
},
|
|
361
|
+
define: { "process.env.NODE_ENV": JSON.stringify(ctx.nitro.options.dev ? "development" : "production") },
|
|
370
362
|
dev: { createEnvironment: (envName, envConfig) => createFetchableDevEnvironment(envName, envConfig, getEnvRunner(ctx), resolve(runtimeDir, "internal/vite/dev-entry.mjs")) }
|
|
371
363
|
};
|
|
372
364
|
}
|
|
@@ -381,7 +373,6 @@ function createServiceEnvironment(ctx, name, serviceConfig) {
|
|
|
381
373
|
emptyOutDir: true
|
|
382
374
|
},
|
|
383
375
|
resolve: {
|
|
384
|
-
noExternal: ctx.nitro.options.dev ? void 0 : [/react/],
|
|
385
376
|
conditions: ctx.nitro.options.exportConditions,
|
|
386
377
|
externalConditions: ctx.nitro.options.exportConditions?.filter((c) => !/browser|wasm/.test(c))
|
|
387
378
|
},
|
package/dist/_libs/local-pkg.mjs
CHANGED
|
@@ -1183,13 +1183,6 @@ function fileURLToPath$1(id) {
|
|
|
1183
1183
|
function pathToFileURL$1(id) {
|
|
1184
1184
|
return pathToFileURL(fileURLToPath$1(id)).toString();
|
|
1185
1185
|
}
|
|
1186
|
-
const INVALID_CHAR_RE = /[\u0000-\u001F"#$&*+,/:;<=>?@[\]^`{|}\u007F]+/g;
|
|
1187
|
-
function sanitizeURIComponent(name = "", replacement = "_") {
|
|
1188
|
-
return name.replace(INVALID_CHAR_RE, replacement).replace(/%../g, replacement);
|
|
1189
|
-
}
|
|
1190
|
-
function sanitizeFilePath(filePath = "") {
|
|
1191
|
-
return filePath.replace(/\?.*$/, "").split(/[/\\]/g).map((p) => sanitizeURIComponent(p)).join("/").replace(/^([A-Za-z])_\//, "$1:/");
|
|
1192
|
-
}
|
|
1193
1186
|
function normalizeid(id) {
|
|
1194
1187
|
if (typeof id !== "string") id = id.toString();
|
|
1195
1188
|
if (/(?:node|data|http|https|file):/.test(id)) return id;
|
|
@@ -1683,4 +1676,4 @@ const isPackageListed = quansync(function* (name, cwd$1) {
|
|
|
1683
1676
|
const isPackageListedSync = isPackageListed.sync;
|
|
1684
1677
|
|
|
1685
1678
|
//#endregion
|
|
1686
|
-
export { findTypeExports as a, parseStaticImport as c,
|
|
1679
|
+
export { findTypeExports as a, parseStaticImport as c, findStaticImports as i, resolve$1 as l, detectSyntax as n, lookupNodeModuleSubpath as o, findExports as r, parseNodeModulePath as s, resolveModule as t, resolveModuleExportNames as u };
|
package/package.json
CHANGED