nitro-nightly 3.1.0-20251024-111905-4718bf73 → 3.1.0-20251024-201544-aec6dd26
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/_chunks/plugin.mjs +29 -14
- package/package.json +2 -2
package/dist/_chunks/plugin.mjs
CHANGED
|
@@ -234,11 +234,6 @@ async function buildEnvironments(ctx, builder) {
|
|
|
234
234
|
`Building [${BuilderNames.nitro}] ${colors.dim(`(${buildInfo.map(([k, v]) => `${k}: \`${v}\``).join(", ")})`)}`
|
|
235
235
|
);
|
|
236
236
|
await copyPublicAssets(nitro);
|
|
237
|
-
await nitro.hooks.callHook(
|
|
238
|
-
"rollup:before",
|
|
239
|
-
nitro,
|
|
240
|
-
builder.environments.nitro.config.build.rollupOptions
|
|
241
|
-
);
|
|
242
237
|
await builder.build(builder.environments.nitro);
|
|
243
238
|
await nitro.close();
|
|
244
239
|
await nitro.hooks.callHook("compiled", nitro);
|
|
@@ -871,7 +866,7 @@ function assetsPlugin(pluginOpts) {
|
|
|
871
866
|
}
|
|
872
867
|
let replacement = importedNames[0];
|
|
873
868
|
if (importedNames.length > 1) {
|
|
874
|
-
newImports.add(`;import * as __assets_runtime from "
|
|
869
|
+
newImports.add(`;import * as __assets_runtime from "virtual:fullstack/runtime";\n`);
|
|
875
870
|
replacement = `__assets_runtime.mergeAssets(${importedNames.join(", ")})`;
|
|
876
871
|
}
|
|
877
872
|
output.update(start, end, `(${replacement})`);
|
|
@@ -894,8 +889,10 @@ function assetsPlugin(pluginOpts) {
|
|
|
894
889
|
external: true
|
|
895
890
|
};
|
|
896
891
|
}
|
|
892
|
+
if (source === "virtual:fullstack/runtime") return { id: source };
|
|
897
893
|
} },
|
|
898
894
|
load: { async handler(id) {
|
|
895
|
+
if (id === "virtual:fullstack/runtime") return runtimeUtils();
|
|
899
896
|
const parsed = parseAssetsVirtual(id);
|
|
900
897
|
if (!parsed) return;
|
|
901
898
|
assert.notEqual(this.environment.name, "client");
|
|
@@ -962,11 +959,12 @@ function assetsPlugin(pluginOpts) {
|
|
|
962
959
|
if (typeof value !== "undefined") {
|
|
963
960
|
if (this.environment.name === "client") return `\0virtual:fullstack/empty-assets`;
|
|
964
961
|
}
|
|
965
|
-
if (source === "virtual:fullstack/runtime") return
|
|
962
|
+
if (source === "virtual:fullstack/runtime") return source;
|
|
966
963
|
}
|
|
967
964
|
},
|
|
968
965
|
load: { async handler(id) {
|
|
969
966
|
if (id === "\0virtual:fullstack/empty-assets") return `export default ${JSON.stringify(EMPTY_ASSETS)}`;
|
|
967
|
+
if (id === "virtual:fullstack/runtime") return runtimeUtils();
|
|
970
968
|
const { filename, query } = parseIdQuery(id);
|
|
971
969
|
const value = query["assets"];
|
|
972
970
|
if (typeof value !== "undefined") {
|
|
@@ -1179,6 +1177,25 @@ function patchCssLinkSelfAccept() {
|
|
|
1179
1177
|
}
|
|
1180
1178
|
};
|
|
1181
1179
|
}
|
|
1180
|
+
function runtimeUtils() {
|
|
1181
|
+
return `
|
|
1182
|
+
export function mergeAssets(...args) {
|
|
1183
|
+
const js = uniqBy(args.flatMap((h) => h.js), (a) => a.href);
|
|
1184
|
+
const css = uniqBy(args.flatMap((h) => h.css), (a) => a.href);
|
|
1185
|
+
const entry = args.filter((arg) => arg.entry)?.[0]?.entry;
|
|
1186
|
+
const raw = { entry, js, css };
|
|
1187
|
+
return { ...raw, merge: (...args$1) => mergeAssets(raw, ...args$1) };
|
|
1188
|
+
}
|
|
1189
|
+
function uniqBy(array, key) {
|
|
1190
|
+
const seen = new Set();
|
|
1191
|
+
return array.filter((item) => {
|
|
1192
|
+
const k = key(item);
|
|
1193
|
+
if (seen.has(k)) return false;
|
|
1194
|
+
seen.add(k);
|
|
1195
|
+
return true;
|
|
1196
|
+
});
|
|
1197
|
+
}`;
|
|
1198
|
+
}
|
|
1182
1199
|
|
|
1183
1200
|
const DEFAULT_EXTENSIONS = [".ts", ".js", ".mts", ".mjs", ".tsx", ".jsx"];
|
|
1184
1201
|
const debug = process.env.NITRO_DEBUG ? (...args) => console.log("[nitro]", ...args) : () => {
|
|
@@ -1522,13 +1539,11 @@ async function setupNitroContext(ctx, configEnv, userConfig) {
|
|
|
1522
1539
|
}
|
|
1523
1540
|
await ctx.nitro.hooks.callHook("build:before", ctx.nitro);
|
|
1524
1541
|
ctx.rollupConfig = await getViteRollupConfig(ctx);
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
);
|
|
1531
|
-
}
|
|
1542
|
+
await ctx.nitro.hooks.callHook(
|
|
1543
|
+
"rollup:before",
|
|
1544
|
+
ctx.nitro,
|
|
1545
|
+
ctx.rollupConfig.config
|
|
1546
|
+
);
|
|
1532
1547
|
if (ctx.nitro.options.dev && !ctx.devWorker) {
|
|
1533
1548
|
ctx.devWorker = createDevWorker(ctx);
|
|
1534
1549
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-nightly",
|
|
3
|
-
"version": "3.1.0-20251024-
|
|
3
|
+
"version": "3.1.0-20251024-201544-aec6dd26",
|
|
4
4
|
"description": "Build and Deploy Universal JavaScript Servers",
|
|
5
5
|
"homepage": "https://nitro.build",
|
|
6
6
|
"repository": "nitrojs/nitro",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@azure/static-web-apps-cli": "^2.0.7",
|
|
76
76
|
"@cloudflare/workers-types": "^4.20251014.0",
|
|
77
77
|
"@deno/types": "^0.0.1",
|
|
78
|
-
"@hiogawa/vite-plugin-fullstack": "
|
|
78
|
+
"@hiogawa/vite-plugin-fullstack": "npm:@pi0/vite-plugin-fullstack",
|
|
79
79
|
"@netlify/edge-functions": "^3.0.1",
|
|
80
80
|
"@netlify/functions": "^5.0.1",
|
|
81
81
|
"@rollup/plugin-alias": "^5.1.1",
|