@finesoft/front 0.1.21 → 0.1.22
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/index.cjs +30 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +30 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1823,35 +1823,40 @@ function copyStaticAssets(ctx, destDir, opts) {
|
|
|
1823
1823
|
fs.rmSync(path.join(destDir, "index.html"), { force: true });
|
|
1824
1824
|
}
|
|
1825
1825
|
}
|
|
1826
|
-
async function prerenderRoutes(ctx
|
|
1826
|
+
async function prerenderRoutes(ctx) {
|
|
1827
1827
|
const { fs, path, root, vite } = ctx;
|
|
1828
1828
|
const { pathToFileURL } = await import(
|
|
1829
1829
|
/* @vite-ignore */
|
|
1830
1830
|
"url"
|
|
1831
1831
|
);
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1832
|
+
const routesExport = ctx.bootstrapEntry ?? "src/lib/bootstrap.ts";
|
|
1833
|
+
let routes = [];
|
|
1834
|
+
const routesFileExists = fs.existsSync(path.resolve(root, routesExport));
|
|
1835
|
+
if (routesFileExists) {
|
|
1836
|
+
await vite.build({
|
|
1837
|
+
root,
|
|
1838
|
+
build: {
|
|
1839
|
+
ssr: routesExport,
|
|
1840
|
+
outDir: path.resolve(root, "dist/server"),
|
|
1841
|
+
emptyOutDir: false,
|
|
1842
|
+
rollupOptions: {
|
|
1843
|
+
output: { entryFileNames: "_routes_prerender.mjs" }
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
resolve: ctx.resolvedResolve
|
|
1847
|
+
});
|
|
1848
|
+
const routesPath = pathToFileURL(
|
|
1849
|
+
path.resolve(root, "dist/server/_routes_prerender.mjs")
|
|
1850
|
+
).href;
|
|
1851
|
+
const routesMod = await import(
|
|
1852
|
+
/* @vite-ignore */
|
|
1853
|
+
routesPath
|
|
1854
|
+
);
|
|
1855
|
+
routes = routesMod.routes ?? routesMod.default ?? [];
|
|
1856
|
+
fs.rmSync(path.resolve(root, "dist/server/_routes_prerender.mjs"), {
|
|
1857
|
+
force: true
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1855
1860
|
const prerenderPaths = /* @__PURE__ */ new Set();
|
|
1856
1861
|
for (const r of routes) {
|
|
1857
1862
|
if (r.renderMode === "prerender" && r.path && !r.path.includes(":")) {
|
|
@@ -2879,6 +2884,7 @@ function finesoftFrontViteConfig(options = {}) {
|
|
|
2879
2884
|
root,
|
|
2880
2885
|
ssrEntry,
|
|
2881
2886
|
setupPath: typeof options.setup === "string" ? options.setup : void 0,
|
|
2887
|
+
bootstrapEntry: options.bootstrapEntry,
|
|
2882
2888
|
locales,
|
|
2883
2889
|
defaultLocale,
|
|
2884
2890
|
templateHtml,
|