mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 22:28:25 +00:00
Fix: Serve frontend with binary
This commit is contained in:
@@ -18,20 +18,34 @@ export const registerExternalNextjs = async (
|
|||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
if (standaloneMode) {
|
if (standaloneMode) {
|
||||||
const nextJsBuildPath = path.join(dir, "frontend-build");
|
const frontendName = process?.pkg ? "frontend" : "frontend-build";
|
||||||
|
|
||||||
|
const nextJsBuildPath = path.join(dir, frontendName);
|
||||||
|
|
||||||
const { default: conf } = (await import(
|
const { default: conf } = (await import(
|
||||||
path.join(dir, "frontend-build/.next/required-server-files.json"),
|
path.join(dir, `${frontendName}/.next/required-server-files.json`),
|
||||||
// @ts-expect-error type
|
// @ts-expect-error type
|
||||||
{
|
{
|
||||||
assert: { type: "json" }
|
assert: { type: "json" }
|
||||||
}
|
}
|
||||||
)) as { default: { config: string } };
|
)) as { default: { config: string } };
|
||||||
|
|
||||||
/* eslint-disable */
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const { default: NextServer } = (
|
let NextServer: any;
|
||||||
await import(path.join(dir, "frontend-build/node_modules/next/dist/server/next-server.js"))
|
|
||||||
).default;
|
if (!process?.pkg) {
|
||||||
|
/* eslint-disable */
|
||||||
|
const { default: nextServer } = (
|
||||||
|
await import(path.join(dir, `${frontendName}/node_modules/next/dist/server/next-server.js`))
|
||||||
|
).default;
|
||||||
|
|
||||||
|
NextServer = nextServer;
|
||||||
|
} else {
|
||||||
|
/* eslint-disable */
|
||||||
|
const nextServer = await import(path.join(dir, `${frontendName}/node_modules/next/dist/server/next-server.js`));
|
||||||
|
|
||||||
|
NextServer = nextServer.default;
|
||||||
|
}
|
||||||
|
|
||||||
const nextApp = new NextServer({
|
const nextApp = new NextServer({
|
||||||
dev: false,
|
dev: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user