@farm.js/core 0.1.0-beta.50 → 0.1.0-beta.51
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/{chunk-6YIZDTX7.mjs → chunk-235ZOXDY.mjs} +43 -5
- package/dist/chunk-235ZOXDY.mjs.map +1 -0
- package/dist/{chunk-DDE3BBDN.mjs → chunk-7XJV5RZO.mjs} +2 -2
- package/dist/{chunk-DDE3BBDN.mjs.map → chunk-7XJV5RZO.mjs.map} +1 -1
- package/dist/{chunk-QTAJIJJJ.mjs → chunk-FRN7PNL4.mjs} +2 -2
- package/dist/{chunk-GM43ZLTS.mjs → chunk-QCSOE6HT.mjs} +2 -2
- package/dist/client/lifecycle.mjs +2 -2
- package/dist/client-plugins.cjs +1 -1
- package/dist/client-plugins.cjs.map +1 -1
- package/dist/client-plugins.mjs +2 -2
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +2 -2
- package/dist/index.cjs +42 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/internal/build-runtime.cjs +42 -4
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.mjs +3 -3
- package/dist/internal/client-runtime.cjs +1 -1
- package/dist/internal/client-runtime.cjs.map +1 -1
- package/dist/internal/client-runtime.mjs +2 -2
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.mjs +2 -2
- package/dist/server.cjs +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.mjs +2 -2
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-6YIZDTX7.mjs.map +0 -1
- /package/dist/{chunk-QTAJIJJJ.mjs.map → chunk-FRN7PNL4.mjs.map} +0 -0
- /package/dist/{chunk-GM43ZLTS.mjs.map → chunk-QCSOE6HT.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-5ZGPRGWV.mjs";
|
|
10
10
|
import {
|
|
11
11
|
build
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-235ZOXDY.mjs";
|
|
13
13
|
import "./chunk-SL6HTIOK.mjs";
|
|
14
14
|
import "./chunk-4S3ORGFA.mjs";
|
|
15
15
|
import {
|
|
@@ -208,7 +208,7 @@ import {
|
|
|
208
208
|
createClientPluginManager,
|
|
209
209
|
installChunkErrorRecovery,
|
|
210
210
|
isChunkLoadError
|
|
211
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-FRN7PNL4.mjs";
|
|
212
212
|
import {
|
|
213
213
|
analyzeStaticRouteCandidate,
|
|
214
214
|
collectSSGPages,
|
|
@@ -227,7 +227,7 @@ import {
|
|
|
227
227
|
parseRouteRenderingDirective,
|
|
228
228
|
resolveRouteRenderingConfig,
|
|
229
229
|
resolveRouteRenderingConfigFromFile
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-QCSOE6HT.mjs";
|
|
231
231
|
import {
|
|
232
232
|
APITypeGenerator
|
|
233
233
|
} from "./chunk-XJTDE4L4.mjs";
|
|
@@ -568,7 +568,7 @@ import {
|
|
|
568
568
|
runWithFarmSpan
|
|
569
569
|
} from "./chunk-7ZMKVETU.mjs";
|
|
570
570
|
import "./chunk-FXG2PS27.mjs";
|
|
571
|
-
import "./chunk-
|
|
571
|
+
import "./chunk-7XJV5RZO.mjs";
|
|
572
572
|
import {
|
|
573
573
|
createCompressionPlugin,
|
|
574
574
|
createEnvPlugin,
|
|
@@ -14918,7 +14918,7 @@ var init_server3 = __esm({
|
|
|
14918
14918
|
var version;
|
|
14919
14919
|
var init_package = __esm({
|
|
14920
14920
|
"package.json"() {
|
|
14921
|
-
version = "0.1.0-beta.
|
|
14921
|
+
version = "0.1.0-beta.51";
|
|
14922
14922
|
}
|
|
14923
14923
|
});
|
|
14924
14924
|
|
|
@@ -32659,16 +32659,45 @@ var FARM_SSR_PACKAGE_IMPORT = "#farm-ssr-entry";
|
|
|
32659
32659
|
var FARM_SSR_OUTPUT_DIR = "farm-ssr";
|
|
32660
32660
|
var FARM_CLIENT_BUILD_TARGET = ["es2020", "edge88", "firefox78", "chrome87", "safari14"];
|
|
32661
32661
|
function resolveNitroRuntimeDependency(root, specifier) {
|
|
32662
|
+
return (0, import_module2.createRequire)(resolveNitroPackageEntry(root)).resolve(specifier).split(import_path13.default.sep).join("/");
|
|
32663
|
+
}
|
|
32664
|
+
__name(resolveNitroRuntimeDependency, "resolveNitroRuntimeDependency");
|
|
32665
|
+
function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveNitroPackageEntry) {
|
|
32666
|
+
let nitroEntry;
|
|
32667
|
+
return {
|
|
32668
|
+
name: "farm-prerender-runtime-resolver",
|
|
32669
|
+
async resolveId(id, _importer, options) {
|
|
32670
|
+
if (options.custom?.farmPrerenderRuntimeResolve) return null;
|
|
32671
|
+
if (id.startsWith("\0") || id.startsWith(".") || id.startsWith("#") || id.startsWith("virtual:") || import_path13.default.isAbsolute(id) || NODE_BUILTIN_MODULES.has(id)) {
|
|
32672
|
+
return null;
|
|
32673
|
+
}
|
|
32674
|
+
if (nitroEntry === void 0) {
|
|
32675
|
+
try {
|
|
32676
|
+
nitroEntry = resolveNitroEntry(root);
|
|
32677
|
+
} catch {
|
|
32678
|
+
nitroEntry = null;
|
|
32679
|
+
}
|
|
32680
|
+
}
|
|
32681
|
+
if (!nitroEntry) return null;
|
|
32682
|
+
return this.resolve(id, nitroEntry, {
|
|
32683
|
+
...options,
|
|
32684
|
+
skipSelf: true,
|
|
32685
|
+
custom: { ...options.custom, farmPrerenderRuntimeResolve: true }
|
|
32686
|
+
});
|
|
32687
|
+
}
|
|
32688
|
+
};
|
|
32689
|
+
}
|
|
32690
|
+
__name(createPrerenderRuntimeResolverPlugin, "createPrerenderRuntimeResolverPlugin");
|
|
32691
|
+
function resolveNitroPackageEntry(root) {
|
|
32662
32692
|
const projectRequire = (0, import_module2.createRequire)(import_path13.default.join(root, "package.json"));
|
|
32663
32693
|
let runtimeRequire = projectRequire;
|
|
32664
32694
|
try {
|
|
32665
32695
|
runtimeRequire = (0, import_module2.createRequire)(projectRequire.resolve("@farm.js/core"));
|
|
32666
32696
|
} catch {
|
|
32667
32697
|
}
|
|
32668
|
-
|
|
32669
|
-
return (0, import_module2.createRequire)(nitroEntry).resolve(specifier).split(import_path13.default.sep).join("/");
|
|
32698
|
+
return runtimeRequire.resolve("nitro");
|
|
32670
32699
|
}
|
|
32671
|
-
__name(
|
|
32700
|
+
__name(resolveNitroPackageEntry, "resolveNitroPackageEntry");
|
|
32672
32701
|
function cloneConfigValue(value, seen = /* @__PURE__ */ new WeakMap()) {
|
|
32673
32702
|
if (value === null || typeof value !== "object") return value;
|
|
32674
32703
|
if (seen.has(value)) return seen.get(value);
|
|
@@ -38934,6 +38963,15 @@ export default async function farmNitroEventHandler(event) {
|
|
|
38934
38963
|
delete prerendererConfig.entry;
|
|
38935
38964
|
});
|
|
38936
38965
|
}
|
|
38966
|
+
nitroInstance.hooks.hook("prerender:init", (prerenderer) => {
|
|
38967
|
+
prerenderer.hooks.hook("rollup:before", (_prerenderNitro, rollupConfig) => {
|
|
38968
|
+
const configuredPlugins = rollupConfig.plugins;
|
|
38969
|
+
rollupConfig.plugins = [
|
|
38970
|
+
...Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [],
|
|
38971
|
+
createPrerenderRuntimeResolverPlugin(config.root)
|
|
38972
|
+
];
|
|
38973
|
+
});
|
|
38974
|
+
});
|
|
38937
38975
|
await nitro.prepare(nitroInstance);
|
|
38938
38976
|
await nitro.copyPublicAssets(nitroInstance);
|
|
38939
38977
|
if (prerenderRoutes.length > 0 && canReusePrebuiltSSR) {
|