@analogjs/vite-plugin-nitro 0.2.28 → 0.2.30-beta.0
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/package.json +1 -1
- package/src/lib/build-server.js +25 -25
- package/src/lib/build-server.js.map +1 -1
- package/src/lib/build-sitemap.js +37 -42
- package/src/lib/build-sitemap.js.map +1 -1
- package/src/lib/build-ssr.js +10 -13
- package/src/lib/build-ssr.js.map +1 -1
- package/src/lib/plugins/dev-server-plugin.js +10 -8
- package/src/lib/plugins/dev-server-plugin.js.map +1 -1
- package/src/lib/plugins/page-endpoints.js +29 -33
- package/src/lib/plugins/page-endpoints.js.map +1 -1
- package/src/lib/runtime/renderer.js +4 -2
- package/src/lib/vite-nitro-plugin.spec.data.js +14 -19
- package/src/lib/vite-nitro-plugin.spec.data.js.map +1 -1
- package/src/lib/vite-plugin-nitro.js +150 -129
- package/src/lib/vite-plugin-nitro.js.map +1 -1
package/package.json
CHANGED
package/src/lib/build-server.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildServer = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const fs = require("fs");
|
|
6
5
|
const post_rendering_hook_1 = require("./hooks/post-rendering-hook");
|
|
7
6
|
const load_esm_1 = require("./utils/load-esm");
|
|
8
|
-
function buildServer(options, nitroConfig) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
(0, post_rendering_hook_1.addPostRenderingHooks)(nitro, options.prerender.postRenderingHooks);
|
|
15
|
-
}
|
|
16
|
-
yield prepare(nitro);
|
|
17
|
-
yield copyPublicAssets(nitro);
|
|
18
|
-
if (((_b = nitroConfig === null || nitroConfig === void 0 ? void 0 : nitroConfig.prerender) === null || _b === void 0 ? void 0 : _b.routes) &&
|
|
19
|
-
((_c = nitroConfig === null || nitroConfig === void 0 ? void 0 : nitroConfig.prerender) === null || _c === void 0 ? void 0 : _c.routes.find((route) => route === '/'))) {
|
|
20
|
-
// Remove the root index.html so it can be replaced with the prerendered version
|
|
21
|
-
if (fs.existsSync(`${(_d = nitroConfig === null || nitroConfig === void 0 ? void 0 : nitroConfig.output) === null || _d === void 0 ? void 0 : _d.publicDir}/index.html`)) {
|
|
22
|
-
fs.unlinkSync(`${(_e = nitroConfig === null || nitroConfig === void 0 ? void 0 : nitroConfig.output) === null || _e === void 0 ? void 0 : _e.publicDir}/index.html`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
console.log(`Prerendering static pages...`);
|
|
26
|
-
yield prerender(nitro);
|
|
27
|
-
if (!(options === null || options === void 0 ? void 0 : options.static)) {
|
|
28
|
-
console.log('Building Server...');
|
|
29
|
-
yield build(nitro);
|
|
30
|
-
}
|
|
31
|
-
yield nitro.close();
|
|
7
|
+
async function buildServer(options, nitroConfig) {
|
|
8
|
+
const { createNitro, build, prepare, copyPublicAssets, prerender } = await (0, load_esm_1.loadEsmModule)('nitropack');
|
|
9
|
+
const nitro = await createNitro({
|
|
10
|
+
dev: false,
|
|
11
|
+
preset: process.env['BUILD_PRESET'],
|
|
12
|
+
...nitroConfig,
|
|
32
13
|
});
|
|
14
|
+
if (options?.prerender?.postRenderingHooks) {
|
|
15
|
+
(0, post_rendering_hook_1.addPostRenderingHooks)(nitro, options.prerender.postRenderingHooks);
|
|
16
|
+
}
|
|
17
|
+
await prepare(nitro);
|
|
18
|
+
await copyPublicAssets(nitro);
|
|
19
|
+
if (nitroConfig?.prerender?.routes &&
|
|
20
|
+
nitroConfig?.prerender?.routes.find((route) => route === '/')) {
|
|
21
|
+
// Remove the root index.html so it can be replaced with the prerendered version
|
|
22
|
+
if (fs.existsSync(`${nitroConfig?.output?.publicDir}/index.html`)) {
|
|
23
|
+
fs.unlinkSync(`${nitroConfig?.output?.publicDir}/index.html`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
console.log(`Prerendering static pages...`);
|
|
27
|
+
await prerender(nitro);
|
|
28
|
+
if (!options?.static) {
|
|
29
|
+
console.log('Building Server...');
|
|
30
|
+
await build(nitro);
|
|
31
|
+
}
|
|
32
|
+
await nitro.close();
|
|
33
33
|
}
|
|
34
34
|
exports.buildServer = buildServer;
|
|
35
35
|
//# sourceMappingURL=build-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-server.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-nitro/src/lib/build-server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-server.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-nitro/src/lib/build-server.ts"],"names":[],"mappings":";;;AACA,yBAAyB;AAGzB,qEAAoE;AACpE,+CAAiD;AAE1C,KAAK,UAAU,WAAW,CAC/B,OAAiB,EACjB,WAAyB;IAEzB,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAChE,MAAM,IAAA,wBAAa,EAA6B,WAAW,CAAC,CAAC;IAE/D,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC;QAC9B,GAAG,EAAE,KAAK;QACV,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;QACnC,GAAG,WAAW;KACf,CAAC,CAAC;IAEH,IAAI,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE;QAC1C,IAAA,2CAAqB,EAAC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;KACpE;IAED,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC;IACrB,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE9B,IACE,WAAW,EAAE,SAAS,EAAE,MAAM;QAC9B,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,GAAG,CAAC,EAC7D;QACA,gFAAgF;QAChF,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,WAAW,EAAE,MAAM,EAAE,SAAS,aAAa,CAAC,EAAE;YACjE,EAAE,CAAC,UAAU,CAAC,GAAG,WAAW,EAAE,MAAM,EAAE,SAAS,aAAa,CAAC,CAAC;SAC/D;KACF;IAED,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAC5C,MAAM,SAAS,CAAC,KAAK,CAAC,CAAC;IAEvB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE;QACpB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAClC,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC;KACpB;IAED,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;AACtB,CAAC;AAvCD,kCAuCC"}
|
package/src/lib/build-sitemap.js
CHANGED
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildSitemap = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const fs = require("fs");
|
|
6
5
|
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
7
6
|
const path = require("path");
|
|
8
|
-
function buildSitemap(config, sitemapConfig, routes, outputDir) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
page.ele('lastmod').txt(item.lastMod);
|
|
22
|
-
}
|
|
23
|
-
const mapPath = `${path.resolve(outputDir)}/sitemap.xml`;
|
|
24
|
-
try {
|
|
25
|
-
console.log(`Writing sitemap at ${mapPath}`);
|
|
26
|
-
fs.writeFileSync(mapPath, sitemap.end({ prettyPrint: true }));
|
|
27
|
-
}
|
|
28
|
-
catch (e) {
|
|
29
|
-
console.error(`Unable to write file at ${mapPath}`, e);
|
|
30
|
-
}
|
|
7
|
+
async function buildSitemap(config, sitemapConfig, routes, outputDir) {
|
|
8
|
+
const routeList = await optionHasRoutes(routes);
|
|
9
|
+
if (routeList.length) {
|
|
10
|
+
const slash = checkSlash(sitemapConfig.host);
|
|
11
|
+
const sitemapData = routeList.map((page) => ({
|
|
12
|
+
page: `${sitemapConfig.host}${slash}${page.replace(/^\/+/g, '')}`,
|
|
13
|
+
lastMod: new Date().toISOString().split('T')[0],
|
|
14
|
+
}));
|
|
15
|
+
const sitemap = createXml('urlset');
|
|
16
|
+
for (const item of sitemapData) {
|
|
17
|
+
const page = sitemap.ele('url');
|
|
18
|
+
page.ele('loc').txt(item.page);
|
|
19
|
+
page.ele('lastmod').txt(item.lastMod);
|
|
31
20
|
}
|
|
32
|
-
|
|
21
|
+
const mapPath = `${path.resolve(outputDir)}/sitemap.xml`;
|
|
22
|
+
try {
|
|
23
|
+
console.log(`Writing sitemap at ${mapPath}`);
|
|
24
|
+
fs.writeFileSync(mapPath, sitemap.end({ prettyPrint: true }));
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
console.error(`Unable to write file at ${mapPath}`, e);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
33
30
|
}
|
|
34
31
|
exports.buildSitemap = buildSitemap;
|
|
35
32
|
function createXml(elementName) {
|
|
@@ -43,22 +40,20 @@ function checkSlash(host) {
|
|
|
43
40
|
const finalChar = host.slice(-1);
|
|
44
41
|
return finalChar === '/' ? '' : '/';
|
|
45
42
|
}
|
|
46
|
-
function optionHasRoutes(routes) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return routeList;
|
|
62
|
-
});
|
|
43
|
+
async function optionHasRoutes(routes) {
|
|
44
|
+
let routeList;
|
|
45
|
+
if (typeof routes === 'function') {
|
|
46
|
+
// returns an array or undefined
|
|
47
|
+
routeList = await routes();
|
|
48
|
+
}
|
|
49
|
+
else if (Array.isArray(routes)) {
|
|
50
|
+
// returns an array of strings
|
|
51
|
+
routeList = routes;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
// default it to an empty of array
|
|
55
|
+
routeList = [];
|
|
56
|
+
}
|
|
57
|
+
return routeList;
|
|
63
58
|
}
|
|
64
59
|
//# sourceMappingURL=build-sitemap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-sitemap.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-nitro/src/lib/build-sitemap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-sitemap.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-nitro/src/lib/build-sitemap.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AAEzB,6CAAqC;AAErC,6BAA6B;AAQtB,KAAK,UAAU,YAAY,CAChC,MAAkB,EAClB,aAA4B,EAC5B,MAA0D,EAC1D,SAAiB;IAEjB,MAAM,SAAS,GAAa,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAE1D,IAAI,SAAS,CAAC,MAAM,EAAE;QACpB,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,WAAW,GAAgB,SAAS,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC;YAChE,IAAI,EAAE,GAAG,aAAa,CAAC,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE;YACjE,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAChD,CAAC,CAAC,CAAC;QAEJ,MAAM,OAAO,GAAG,SAAS,CAAC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AEtC,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;QAChC,gCAAgC;QAChC,SAAS,GAAG,MAAM,MAAM,EAAE,CAAC;KAC5B;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAChC,8BAA8B;QAC9B,SAAS,GAAG,MAAM,CAAC;KACpB;SAAM;QACL,kCAAkC;QAClC,SAAS,GAAG,EAAE,CAAC;KAChB;IAED,OAAO,SAAqB,CAAC;AAC/B,CAAC"}
|
package/src/lib/build-ssr.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildSSRApp = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const vite_1 = require("vite");
|
|
6
5
|
const path = require("path");
|
|
7
|
-
function buildSSRApp(config, options) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
input: (options === null || options === void 0 ? void 0 : options.entryServer) || path.resolve(rootDir, './src/main.server.ts'),
|
|
15
|
-
},
|
|
16
|
-
outDir: (options === null || options === void 0 ? void 0 : options.ssrBuildDir) || path.resolve('dist', rootDir, 'ssr'),
|
|
6
|
+
async function buildSSRApp(config, options) {
|
|
7
|
+
const rootDir = config.root || '.';
|
|
8
|
+
const ssrBuildConfig = (0, vite_1.mergeConfig)(config, {
|
|
9
|
+
build: {
|
|
10
|
+
ssr: true,
|
|
11
|
+
rollupOptions: {
|
|
12
|
+
input: options?.entryServer || path.resolve(rootDir, './src/main.server.ts'),
|
|
17
13
|
},
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
outDir: options?.ssrBuildDir || path.resolve('dist', rootDir, 'ssr'),
|
|
15
|
+
},
|
|
20
16
|
});
|
|
17
|
+
await (0, vite_1.build)(ssrBuildConfig);
|
|
21
18
|
}
|
|
22
19
|
exports.buildSSRApp = buildSSRApp;
|
|
23
20
|
//# sourceMappingURL=build-ssr.js.map
|
package/src/lib/build-ssr.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-ssr.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-nitro/src/lib/build-ssr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-ssr.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-nitro/src/lib/build-ssr.ts"],"names":[],"mappings":";;;AAAA,+BAAsD;AACtD,6BAA6B;AAItB,KAAK,UAAU,WAAW,CAAC,MAAkB,EAAE,OAAiB;IACrE,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC;IACnC,MAAM,cAAc,GAAG,IAAA,kBAAW,EAAC,MAAM,EAAE;QACzC,KAAK,EAAE;YACL,GAAG,EAAE,IAAI;YACT,aAAa,EAAE;gBACb,KAAK,EACH,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,sBAAsB,CAAC;aACxE;YACD,MAAM,EAAE,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;SACrE;KACF,CAAC,CAAC;IAEH,MAAM,IAAA,YAAK,EAAC,cAAc,CAAC,CAAC;AAC9B,CAAC;AAdD,kCAcC"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// https://github.com/solidjs/solid-start/blob/main/packages/start/dev/server.js
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.devServerPlugin = void 0;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
6
|
const path = require("path");
|
|
8
7
|
const fs = require("fs");
|
|
9
8
|
function devServerPlugin(options) {
|
|
@@ -21,14 +20,17 @@ function devServerPlugin(options) {
|
|
|
21
20
|
};
|
|
22
21
|
},
|
|
23
22
|
configureServer(viteServer) {
|
|
24
|
-
return () =>
|
|
23
|
+
return async () => {
|
|
25
24
|
remove_html_middlewares(viteServer.middlewares);
|
|
26
|
-
viteServer.middlewares.use((req, res) =>
|
|
25
|
+
viteServer.middlewares.use(async (req, res) => {
|
|
27
26
|
let template = fs.readFileSync(path.resolve(viteServer.config.root, index), 'utf-8');
|
|
28
|
-
template =
|
|
27
|
+
template = await viteServer.transformIndexHtml(req.originalUrl, template);
|
|
29
28
|
try {
|
|
30
|
-
const entryServer = (
|
|
31
|
-
const result =
|
|
29
|
+
const entryServer = (await viteServer.ssrLoadModule('~analog/entry-server'))['default'];
|
|
30
|
+
const result = await entryServer(req.originalUrl, template, {
|
|
31
|
+
req,
|
|
32
|
+
res,
|
|
33
|
+
});
|
|
32
34
|
res.setHeader('Content-Type', 'text/html');
|
|
33
35
|
res.end(result);
|
|
34
36
|
}
|
|
@@ -51,8 +53,8 @@ function devServerPlugin(options) {
|
|
|
51
53
|
</html>
|
|
52
54
|
`);
|
|
53
55
|
}
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
56
58
|
},
|
|
57
59
|
};
|
|
58
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server-plugin.js","sourceRoot":"","sources":["../../../../../../packages/vite-plugin-nitro/src/lib/plugins/dev-server-plugin.ts"],"names":[],"mappings":";AAAA,iEAAiE;AACjE,gFAAgF
|
|
1
|
+
{"version":3,"file":"dev-server-plugin.js","sourceRoot":"","sources":["../../../../../../packages/vite-plugin-nitro/src/lib/plugins/dev-server-plugin.ts"],"names":[],"mappings":";AAAA,iEAAiE;AACjE,gFAAgF;;;AAGhF,6BAA6B;AAC7B,yBAAyB;AAOzB,SAAgB,eAAe,CAAC,OAAsB;IACpD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,oBAAoB,CAAC;IAChE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,YAAY,CAAC;IAE5C,OAAO;QACL,IAAI,EAAE,yBAAyB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AAC;qBACJ;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAhED,0CAgEC;AAED;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,MAAoC;IACnE,MAAM,gBAAgB,GAAG;QACvB,yBAAyB;QACzB,mBAAmB;QACnB,2BAA2B;KAC5B,CAAC;IACF,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QAChD,aAAa;QACb,IAAI,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YAC1D,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC3B;KACF;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,YAAY,CAAC,GAA4B,EAAE,KAAc;IAChE,MAAM,CAAC,GAAG,KAAc,CAAC;IACzB,OAAO;QACL,OAAO,EAAE,2CAA2C,GAAG,CAAC,GAAG,UACzD,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAChC,GAAG;QACH,KAAK,EAAE,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -1,41 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pageEndpointsPlugin = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const esbuild_1 = require("esbuild");
|
|
6
5
|
const vite_1 = require("vite");
|
|
7
6
|
function pageEndpointsPlugin() {
|
|
8
7
|
return {
|
|
9
8
|
name: 'analogjs-vite-plugin-nitro-rollup-page-endpoint',
|
|
10
|
-
transform(_code, id) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if ((_b = compiled.metafile) === null || _b === void 0 ? void 0 : _b.outputs[key].entryPoint) {
|
|
30
|
-
fileExports = (_c = compiled.metafile) === null || _c === void 0 ? void 0 : _c.outputs[key].exports;
|
|
31
|
-
}
|
|
9
|
+
async transform(_code, id) {
|
|
10
|
+
if ((0, vite_1.normalizePath)(id).includes('src/app/pages') &&
|
|
11
|
+
id.endsWith('.server.ts')) {
|
|
12
|
+
const compiled = (0, esbuild_1.buildSync)({
|
|
13
|
+
stdin: {
|
|
14
|
+
contents: _code,
|
|
15
|
+
sourcefile: id,
|
|
16
|
+
loader: 'ts',
|
|
17
|
+
},
|
|
18
|
+
write: false,
|
|
19
|
+
metafile: true,
|
|
20
|
+
platform: 'neutral',
|
|
21
|
+
format: 'esm',
|
|
22
|
+
logLevel: 'silent',
|
|
23
|
+
});
|
|
24
|
+
let fileExports = [];
|
|
25
|
+
for (let key in compiled.metafile?.outputs) {
|
|
26
|
+
if (compiled.metafile?.outputs[key].entryPoint) {
|
|
27
|
+
fileExports = compiled.metafile?.outputs[key].exports;
|
|
32
28
|
}
|
|
33
|
-
|
|
29
|
+
}
|
|
30
|
+
const code = `
|
|
34
31
|
import { defineEventHandler } from 'h3';
|
|
35
32
|
|
|
36
33
|
${fileExports.includes('load')
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
? _code
|
|
35
|
+
: `
|
|
39
36
|
${_code}
|
|
40
37
|
export const load = () => {
|
|
41
38
|
return {};
|
|
@@ -56,13 +53,12 @@ function pageEndpointsPlugin() {
|
|
|
56
53
|
}
|
|
57
54
|
});
|
|
58
55
|
`;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
56
|
+
return {
|
|
57
|
+
code,
|
|
58
|
+
map: null,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
66
62
|
},
|
|
67
63
|
};
|
|
68
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-endpoints.js","sourceRoot":"","sources":["../../../../../../packages/vite-plugin-nitro/src/lib/plugins/page-endpoints.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page-endpoints.js","sourceRoot":"","sources":["../../../../../../packages/vite-plugin-nitro/src/lib/plugins/page-endpoints.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AACpC,+BAAqC;AAErC,SAAgB,mBAAmB;IACjC,OAAO;QACL,IAAI,EAAE,iDAAiD;QACvD,KAAK,CAAC,SAAS,CAAC,KAAa,EAAE,EAAU;YACvC,IACE,IAAA,oBAAa,EAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;gBAC3C,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,EACzB;gBACA,MAAM,QAAQ,GAAG,IAAA,mBAAS,EAAC;oBACzB,KAAK,EAAE;wBACL,QAAQ,EAAE,KAAK;wBACf,UAAU,EAAE,EAAE;wBACd,MAAM,EAAE,IAAI;qBACb;oBACD,KAAK,EAAE,KAAK;oBACZ,QAAQ,EAAE,IAAI;oBACd,QAAQ,EAAE,SAAS;oBACnB,MAAM,EAAE,KAAK;oBACb,QAAQ,EAAE,QAAQ;iBACnB,CAAC,CAAC;gBAEH,IAAI,WAAW,GAAa,EAAE,CAAC;gBAE/B,KAAK,IAAI,GAAG,IAAI,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE;oBAC1C,IAAI,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE;wBAC9C,WAAW,GAAG,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;qBACvD;iBACF;gBAED,MAAM,IAAI,GAAG;;;cAIP,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC;oBAC1B,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC;kBACA,KAAK;;;kBAIX;;;;;;;;;;;;;;;;WAgBD,CAAC;gBAEJ,OAAO;oBACL,IAAI;oBACJ,GAAG,EAAE,IAAI;iBACV,CAAC;aACH;YAED,OAAO;QACT,CAAC;KACF,CAAC;AACJ,CAAC;AAnED,kDAmEC"}
|
|
@@ -12,7 +12,9 @@ import renderer from '#analog/ssr';
|
|
|
12
12
|
import template from '#analog/index';
|
|
13
13
|
|
|
14
14
|
export default eventHandler(async (event) => {
|
|
15
|
-
const html = await renderer(event.node.req.url, template
|
|
16
|
-
|
|
15
|
+
const html = await renderer(event.node.req.url, template, {
|
|
16
|
+
req: event.node.req,
|
|
17
|
+
res: event.node.res,
|
|
18
|
+
});
|
|
17
19
|
return html;
|
|
18
20
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runConfigAndCloseBundle = exports.mockBuildFunctions = exports.mockNitroConfig = exports.mockViteDevServer = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const vitest_1 = require("vitest");
|
|
6
5
|
const path = require("path");
|
|
7
6
|
exports.mockViteDevServer = {
|
|
@@ -37,26 +36,22 @@ exports.mockNitroConfig = {
|
|
|
37
36
|
],
|
|
38
37
|
},
|
|
39
38
|
};
|
|
40
|
-
function mockBuildFunctions() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return { buildSSRAppImportSpy, buildServerImportSpy, buildSitemapImportSpy };
|
|
52
|
-
});
|
|
39
|
+
async function mockBuildFunctions() {
|
|
40
|
+
const buildServerImport = await Promise.resolve().then(() => require('./build-server'));
|
|
41
|
+
const buildServerImportSpy = vitest_1.vi.fn();
|
|
42
|
+
buildServerImport.buildServer = buildServerImportSpy;
|
|
43
|
+
const buildSSRAppImport = await Promise.resolve().then(() => require('./build-ssr'));
|
|
44
|
+
const buildSSRAppImportSpy = vitest_1.vi.fn();
|
|
45
|
+
buildSSRAppImport.buildSSRApp = buildSSRAppImportSpy;
|
|
46
|
+
const buildSitemapImport = await Promise.resolve().then(() => require('./build-sitemap'));
|
|
47
|
+
const buildSitemapImportSpy = vitest_1.vi.fn();
|
|
48
|
+
buildSitemapImport.buildSitemap = buildSitemapImportSpy;
|
|
49
|
+
return { buildSSRAppImportSpy, buildServerImportSpy, buildSitemapImportSpy };
|
|
53
50
|
}
|
|
54
51
|
exports.mockBuildFunctions = mockBuildFunctions;
|
|
55
|
-
function runConfigAndCloseBundle(plugin) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
yield plugin[1].closeBundle();
|
|
59
|
-
});
|
|
52
|
+
async function runConfigAndCloseBundle(plugin) {
|
|
53
|
+
await plugin[1].config({}, { command: 'build' });
|
|
54
|
+
await plugin[1].closeBundle();
|
|
60
55
|
}
|
|
61
56
|
exports.runConfigAndCloseBundle = runConfigAndCloseBundle;
|
|
62
57
|
//# sourceMappingURL=vite-nitro-plugin.spec.data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-nitro-plugin.spec.data.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-nitro/src/lib/vite-nitro-plugin.spec.data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vite-nitro-plugin.spec.data.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-nitro/src/lib/vite-nitro-plugin.spec.data.ts"],"names":[],"mappings":";;;AAEA,mCAAkC;AACl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BAAoB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAC;AAC/E,CAAC;AAdD,gDAcC;AAEM,KAAK,UAAU,uBAAuB,CAAC,MAAgB;IAC5D,MACE,MAAM,CAAC,CAAC,CAAC,CAAC,MAIX,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAe,CAAC,CAAC;IACzC,MAAO,MAAM,CAAC,CAAC,CAAC,CAAC,WAAmC,EAAE,CAAC;AACzD,CAAC;AARD,0DAQC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.nitro = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const h3_1 = require("h3");
|
|
6
5
|
const vite_1 = require("vite");
|
|
7
6
|
const path = require("path");
|
|
@@ -14,168 +13,190 @@ const dev_server_plugin_1 = require("./plugins/dev-server-plugin");
|
|
|
14
13
|
const load_esm_1 = require("./utils/load-esm");
|
|
15
14
|
let clientOutputPath = '';
|
|
16
15
|
function nitro(options, nitroOptions) {
|
|
17
|
-
|
|
18
|
-
const workspaceRoot = (_a = options === null || options === void 0 ? void 0 : options.workspaceRoot) !== null && _a !== void 0 ? _a : process.cwd();
|
|
16
|
+
const workspaceRoot = options?.workspaceRoot ?? process.cwd();
|
|
19
17
|
const isTest = process.env['NODE_ENV'] === 'test' || !!process.env['VITEST'];
|
|
20
|
-
const apiPrefix = `/${
|
|
18
|
+
const apiPrefix = `/${nitroOptions?.runtimeConfig?.['apiPrefix'] ?? 'api'}`;
|
|
21
19
|
let isBuild = false;
|
|
22
20
|
let isServe = false;
|
|
23
21
|
let ssrBuild = false;
|
|
24
22
|
let config;
|
|
25
23
|
let nitroConfig;
|
|
26
24
|
return [
|
|
27
|
-
(
|
|
25
|
+
(options?.ssr
|
|
28
26
|
? (0, dev_server_plugin_1.devServerPlugin)({
|
|
29
|
-
entryServer: options
|
|
30
|
-
index: options
|
|
27
|
+
entryServer: options?.entryServer,
|
|
28
|
+
index: options?.index,
|
|
31
29
|
})
|
|
32
30
|
: false),
|
|
33
31
|
{
|
|
34
32
|
name: '@analogjs/vite-plugin-nitro',
|
|
35
|
-
config(_config, { command }) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
33
|
+
async config(_config, { command }) {
|
|
34
|
+
isServe = command === 'serve';
|
|
35
|
+
isBuild = command === 'build';
|
|
36
|
+
ssrBuild = _config.build?.ssr === true;
|
|
37
|
+
config = _config;
|
|
38
|
+
const rootDir = config.root || '.';
|
|
39
|
+
const buildPreset = process.env['BUILD_PRESET'] ??
|
|
40
|
+
nitroOptions?.preset;
|
|
41
|
+
const pageHandlers = (0, get_page_handlers_1.getPageHandlers)({ workspaceRoot, rootDir });
|
|
42
|
+
nitroConfig = {
|
|
43
|
+
rootDir,
|
|
44
|
+
preset: buildPreset,
|
|
45
|
+
logLevel: nitroOptions?.logLevel || 0,
|
|
46
|
+
srcDir: (0, vite_1.normalizePath)(`${rootDir}/src/server`),
|
|
47
|
+
scanDirs: [(0, vite_1.normalizePath)(`${rootDir}/src/server`)],
|
|
48
|
+
output: {
|
|
49
|
+
dir: (0, vite_1.normalizePath)(path.resolve(workspaceRoot, 'dist', rootDir, 'analog')),
|
|
50
|
+
publicDir: (0, vite_1.normalizePath)(path.resolve(workspaceRoot, 'dist', rootDir, 'analog/public')),
|
|
51
|
+
...nitroOptions?.output,
|
|
52
|
+
},
|
|
53
|
+
buildDir: (0, vite_1.normalizePath)(path.resolve(workspaceRoot, 'dist', rootDir, '.nitro')),
|
|
54
|
+
typescript: {
|
|
55
|
+
generateTsConfig: false,
|
|
56
|
+
},
|
|
57
|
+
runtimeConfig: { ...nitroOptions?.runtimeConfig },
|
|
58
|
+
rollupConfig: {
|
|
59
|
+
onwarn(warning) {
|
|
60
|
+
if (warning.message.includes('empty chunk') &&
|
|
61
|
+
warning.message.endsWith('.server')) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
55
64
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
plugins: [(0, page_endpoints_1.pageEndpointsPlugin)()],
|
|
65
|
+
plugins: [(0, page_endpoints_1.pageEndpointsPlugin)()],
|
|
66
|
+
},
|
|
67
|
+
handlers: [
|
|
68
|
+
{
|
|
69
|
+
handler: (0, vite_1.normalizePath)(`${__dirname}/runtime/api-middleware`),
|
|
70
|
+
middleware: true,
|
|
65
71
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
...pageHandlers,
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
if (isVercelPreset(buildPreset)) {
|
|
76
|
+
nitroConfig = withVercelOutputAPI(nitroConfig, workspaceRoot);
|
|
77
|
+
}
|
|
78
|
+
if (!ssrBuild && !isTest) {
|
|
79
|
+
// store the client output path for the SSR build config
|
|
80
|
+
clientOutputPath = path.resolve(rootDir, config.build?.outDir || 'dist/client');
|
|
81
|
+
}
|
|
82
|
+
nitroConfig.alias = {
|
|
83
|
+
'#analog/ssr': (0, vite_1.normalizePath)(path.resolve(workspaceRoot, 'dist', rootDir, 'ssr/main.server')),
|
|
84
|
+
'#analog/index': (0, vite_1.normalizePath)(path.resolve(clientOutputPath, 'index.html')),
|
|
85
|
+
...nitroOptions?.alias,
|
|
86
|
+
};
|
|
87
|
+
if (isBuild) {
|
|
88
|
+
if (isEmptyPrerenderRoutes(options)) {
|
|
89
|
+
nitroConfig.prerender = {};
|
|
90
|
+
nitroConfig.prerender.routes = ['/'];
|
|
80
91
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if (options === null || options === void 0 ? void 0 : options.prerender) {
|
|
88
|
-
nitroConfig.prerender = (_d = nitroConfig.prerender) !== null && _d !== void 0 ? _d : {};
|
|
89
|
-
nitroConfig.prerender.crawlLinks = (_e = options === null || options === void 0 ? void 0 : options.prerender) === null || _e === void 0 ? void 0 : _e.discover;
|
|
90
|
-
const prerenderRoutes = (_f = options === null || options === void 0 ? void 0 : options.prerender) === null || _f === void 0 ? void 0 : _f.routes;
|
|
91
|
-
if (isArrayWithElements(prerenderRoutes)) {
|
|
92
|
-
nitroConfig.prerender.routes = prerenderRoutes;
|
|
93
|
-
}
|
|
94
|
-
else if (typeof prerenderRoutes === 'function') {
|
|
95
|
-
nitroConfig.prerender.routes = yield prerenderRoutes();
|
|
96
|
-
}
|
|
92
|
+
if (options?.prerender) {
|
|
93
|
+
nitroConfig.prerender = nitroConfig.prerender ?? {};
|
|
94
|
+
nitroConfig.prerender.crawlLinks = options?.prerender?.discover;
|
|
95
|
+
const prerenderRoutes = options?.prerender?.routes;
|
|
96
|
+
if (isArrayWithElements(prerenderRoutes)) {
|
|
97
|
+
nitroConfig.prerender.routes = prerenderRoutes;
|
|
97
98
|
}
|
|
98
|
-
if (
|
|
99
|
-
nitroConfig =
|
|
100
|
-
{
|
|
101
|
-
baseName: 'public',
|
|
102
|
-
dir: clientOutputPath,
|
|
103
|
-
},
|
|
104
|
-
], externals: Object.assign(Object.assign({}, nitroOptions === null || nitroOptions === void 0 ? void 0 : nitroOptions.externals), { external: [
|
|
105
|
-
'rxjs',
|
|
106
|
-
'node-fetch-native/dist/polyfill',
|
|
107
|
-
...(((_g = nitroOptions === null || nitroOptions === void 0 ? void 0 : nitroOptions.externals) === null || _g === void 0 ? void 0 : _g.external) || []),
|
|
108
|
-
] }), moduleSideEffects: [
|
|
109
|
-
'zone.js/node',
|
|
110
|
-
'zone.js/fesm2015/zone-node',
|
|
111
|
-
...((nitroOptions === null || nitroOptions === void 0 ? void 0 : nitroOptions.moduleSideEffects) || []),
|
|
112
|
-
], renderer: (0, vite_1.normalizePath)(`${__dirname}/runtime/renderer`), handlers: [
|
|
113
|
-
{
|
|
114
|
-
handler: (0, vite_1.normalizePath)(`${__dirname}/runtime/api-middleware`),
|
|
115
|
-
middleware: true,
|
|
116
|
-
},
|
|
117
|
-
...pageHandlers,
|
|
118
|
-
] });
|
|
99
|
+
else if (typeof prerenderRoutes === 'function') {
|
|
100
|
+
nitroConfig.prerender.routes = await prerenderRoutes();
|
|
119
101
|
}
|
|
120
102
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
103
|
+
if (ssrBuild) {
|
|
104
|
+
nitroConfig = {
|
|
105
|
+
...nitroConfig,
|
|
106
|
+
publicAssets: [{ dir: clientOutputPath }],
|
|
107
|
+
serverAssets: [
|
|
108
|
+
{
|
|
109
|
+
baseName: 'public',
|
|
110
|
+
dir: clientOutputPath,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
externals: {
|
|
114
|
+
...nitroOptions?.externals,
|
|
115
|
+
external: [
|
|
116
|
+
'rxjs',
|
|
117
|
+
'node-fetch-native/dist/polyfill',
|
|
118
|
+
...(nitroOptions?.externals?.external || []),
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
moduleSideEffects: [
|
|
122
|
+
'zone.js/node',
|
|
123
|
+
'zone.js/fesm2015/zone-node',
|
|
124
|
+
...(nitroOptions?.moduleSideEffects || []),
|
|
125
|
+
],
|
|
126
|
+
renderer: (0, vite_1.normalizePath)(`${__dirname}/runtime/renderer`),
|
|
127
|
+
handlers: [
|
|
128
|
+
{
|
|
129
|
+
handler: (0, vite_1.normalizePath)(`${__dirname}/runtime/api-middleware`),
|
|
130
|
+
middleware: true,
|
|
131
|
+
},
|
|
132
|
+
...pageHandlers,
|
|
133
|
+
],
|
|
134
|
+
};
|
|
140
135
|
}
|
|
141
|
-
}
|
|
136
|
+
}
|
|
137
|
+
nitroConfig = {
|
|
138
|
+
...nitroConfig,
|
|
139
|
+
...nitroOptions,
|
|
140
|
+
};
|
|
142
141
|
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
async configureServer(viteServer) {
|
|
143
|
+
if (isServe && !isTest) {
|
|
144
|
+
const { createNitro, createDevServer, build } = await (0, load_esm_1.loadEsmModule)('nitropack');
|
|
145
|
+
const nitro = await createNitro({
|
|
146
|
+
dev: true,
|
|
147
|
+
...nitroConfig,
|
|
148
|
+
});
|
|
149
|
+
const server = createDevServer(nitro);
|
|
150
|
+
await build(nitro);
|
|
151
|
+
viteServer.middlewares.use(apiPrefix, (0, h3_1.toNodeListener)(server.app));
|
|
152
|
+
viteServer.httpServer?.once('listening', () => {
|
|
153
|
+
process.env['ANALOG_HOST'] = !viteServer.config.server.host
|
|
154
|
+
? 'localhost'
|
|
155
|
+
: viteServer.config.server.host;
|
|
156
|
+
process.env['ANALOG_PORT'] = `${viteServer.config.server.port}`;
|
|
157
|
+
});
|
|
158
|
+
console.log(`\n\nThe server endpoints are accessible under the "${apiPrefix}" path.`);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
async closeBundle() {
|
|
162
|
+
if (ssrBuild) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (isBuild) {
|
|
166
|
+
if (options?.ssr) {
|
|
167
|
+
console.log('Building SSR application...');
|
|
168
|
+
await (0, build_ssr_1.buildSSRApp)(config, options);
|
|
148
169
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
yield (0, build_server_1.buildServer)(options, nitroConfig);
|
|
155
|
-
if ((_a = options === null || options === void 0 ? void 0 : options.prerender) === null || _a === void 0 ? void 0 : _a.sitemap) {
|
|
156
|
-
console.log('Building Sitemap...');
|
|
157
|
-
// sitemap needs to be built after all directories are built
|
|
158
|
-
yield (0, build_sitemap_1.buildSitemap)(config, options.prerender.sitemap, options.prerender.routes, (_b = nitroConfig.output) === null || _b === void 0 ? void 0 : _b.publicDir);
|
|
159
|
-
}
|
|
160
|
-
console.log(`\n\nThe '@analogjs/platform' server has been successfully built.`);
|
|
170
|
+
await (0, build_server_1.buildServer)(options, nitroConfig);
|
|
171
|
+
if (options?.prerender?.sitemap) {
|
|
172
|
+
console.log('Building Sitemap...');
|
|
173
|
+
// sitemap needs to be built after all directories are built
|
|
174
|
+
await (0, build_sitemap_1.buildSitemap)(config, options.prerender.sitemap, options.prerender.routes, nitroConfig.output?.publicDir);
|
|
161
175
|
}
|
|
162
|
-
|
|
176
|
+
console.log(`\n\nThe '@analogjs/platform' server has been successfully built.`);
|
|
177
|
+
}
|
|
163
178
|
},
|
|
164
179
|
},
|
|
165
180
|
];
|
|
166
181
|
}
|
|
167
182
|
exports.nitro = nitro;
|
|
168
183
|
function isEmptyPrerenderRoutes(options) {
|
|
169
|
-
|
|
170
|
-
if (!options || isArrayWithElements((_a = options === null || options === void 0 ? void 0 : options.prerender) === null || _a === void 0 ? void 0 : _a.routes)) {
|
|
184
|
+
if (!options || isArrayWithElements(options?.prerender?.routes)) {
|
|
171
185
|
return false;
|
|
172
186
|
}
|
|
173
|
-
return !
|
|
187
|
+
return !options.prerender?.routes;
|
|
174
188
|
}
|
|
175
189
|
function isArrayWithElements(arr) {
|
|
176
190
|
return !!(Array.isArray(arr) && arr.length);
|
|
177
191
|
}
|
|
178
192
|
const isVercelPreset = (buildPreset) => process.env['VERCEL'] ||
|
|
179
193
|
(buildPreset && buildPreset.toLowerCase().includes('vercel'));
|
|
180
|
-
const withVercelOutputAPI = (nitroConfig, workspaceRoot) => (
|
|
194
|
+
const withVercelOutputAPI = (nitroConfig, workspaceRoot) => ({
|
|
195
|
+
...nitroConfig,
|
|
196
|
+
output: {
|
|
197
|
+
...nitroConfig?.output,
|
|
198
|
+
dir: (0, vite_1.normalizePath)(path.resolve(workspaceRoot, '.vercel', 'output')),
|
|
199
|
+
publicDir: (0, vite_1.normalizePath)(path.resolve(workspaceRoot, '.vercel', 'output/static')),
|
|
200
|
+
},
|
|
201
|
+
});
|
|
181
202
|
//# sourceMappingURL=vite-plugin-nitro.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin-nitro.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-nitro/src/lib/vite-plugin-nitro.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vite-plugin-nitro.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-nitro/src/lib/vite-plugin-nitro.ts"],"names":[],"mappings":";;;AACA,2BAAyC;AAEzC,+BAAoD;AACpD,6BAA6B;AAE7B,iDAA6C;AAC7C,2CAA0C;AAG1C,6DAA+D;AAC/D,iEAA4D;AAC5D,mDAA+C;AAC/C,mEAA8D;AAC9D,+CAAiD;AAEjD,IAAI,gBAAgB,GAAG,EAAE,CAAC;AAE1B,SAAgB,KAAK,CAAC,OAAiB,EAAE,YAA0B;IACjE,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7E,MAAM,SAAS,GAAG,IAAI,YAAY,EAA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