nitro-nightly 3.1.0-20251024-111905-4718bf73 → 3.1.0-20251024-135426-4da5803f
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 +24 -2
- package/package.json +2 -2
package/dist/_chunks/plugin.mjs
CHANGED
|
@@ -871,7 +871,7 @@ function assetsPlugin(pluginOpts) {
|
|
|
871
871
|
}
|
|
872
872
|
let replacement = importedNames[0];
|
|
873
873
|
if (importedNames.length > 1) {
|
|
874
|
-
newImports.add(`;import * as __assets_runtime from "
|
|
874
|
+
newImports.add(`;import * as __assets_runtime from "virtual:fullstack/runtime";\n`);
|
|
875
875
|
replacement = `__assets_runtime.mergeAssets(${importedNames.join(", ")})`;
|
|
876
876
|
}
|
|
877
877
|
output.update(start, end, `(${replacement})`);
|
|
@@ -894,8 +894,10 @@ function assetsPlugin(pluginOpts) {
|
|
|
894
894
|
external: true
|
|
895
895
|
};
|
|
896
896
|
}
|
|
897
|
+
if (source === "virtual:fullstack/runtime") return { id: source };
|
|
897
898
|
} },
|
|
898
899
|
load: { async handler(id) {
|
|
900
|
+
if (id === "virtual:fullstack/runtime") return runtimeUtils();
|
|
899
901
|
const parsed = parseAssetsVirtual(id);
|
|
900
902
|
if (!parsed) return;
|
|
901
903
|
assert.notEqual(this.environment.name, "client");
|
|
@@ -962,11 +964,12 @@ function assetsPlugin(pluginOpts) {
|
|
|
962
964
|
if (typeof value !== "undefined") {
|
|
963
965
|
if (this.environment.name === "client") return `\0virtual:fullstack/empty-assets`;
|
|
964
966
|
}
|
|
965
|
-
if (source === "virtual:fullstack/runtime") return
|
|
967
|
+
if (source === "virtual:fullstack/runtime") return source;
|
|
966
968
|
}
|
|
967
969
|
},
|
|
968
970
|
load: { async handler(id) {
|
|
969
971
|
if (id === "\0virtual:fullstack/empty-assets") return `export default ${JSON.stringify(EMPTY_ASSETS)}`;
|
|
972
|
+
if (id === "virtual:fullstack/runtime") return runtimeUtils();
|
|
970
973
|
const { filename, query } = parseIdQuery(id);
|
|
971
974
|
const value = query["assets"];
|
|
972
975
|
if (typeof value !== "undefined") {
|
|
@@ -1179,6 +1182,25 @@ function patchCssLinkSelfAccept() {
|
|
|
1179
1182
|
}
|
|
1180
1183
|
};
|
|
1181
1184
|
}
|
|
1185
|
+
function runtimeUtils() {
|
|
1186
|
+
return `
|
|
1187
|
+
export function mergeAssets(...args) {
|
|
1188
|
+
const js = uniqBy(args.flatMap((h) => h.js), (a) => a.href);
|
|
1189
|
+
const css = uniqBy(args.flatMap((h) => h.css), (a) => a.href);
|
|
1190
|
+
const entry = args.filter((arg) => arg.entry)?.[0]?.entry;
|
|
1191
|
+
const raw = { entry, js, css };
|
|
1192
|
+
return { ...raw, merge: (...args$1) => mergeAssets(raw, ...args$1) };
|
|
1193
|
+
}
|
|
1194
|
+
function uniqBy(array, key) {
|
|
1195
|
+
const seen = new Set();
|
|
1196
|
+
return array.filter((item) => {
|
|
1197
|
+
const k = key(item);
|
|
1198
|
+
if (seen.has(k)) return false;
|
|
1199
|
+
seen.add(k);
|
|
1200
|
+
return true;
|
|
1201
|
+
});
|
|
1202
|
+
}`;
|
|
1203
|
+
}
|
|
1182
1204
|
|
|
1183
1205
|
const DEFAULT_EXTENSIONS = [".ts", ".js", ".mts", ".mjs", ".tsx", ".jsx"];
|
|
1184
1206
|
const debug = process.env.NITRO_DEBUG ? (...args) => console.log("[nitro]", ...args) : () => {
|
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-135426-4da5803f",
|
|
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",
|