@qwik.dev/router 2.0.0-beta.39 → 2.0.0-beta.40
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/lib/adapters/azure-swa/vite/index.mjs +45 -54
- package/lib/adapters/bun-server/vite/index.mjs +16 -22
- package/lib/adapters/cloud-run/vite/index.mjs +15 -19
- package/lib/adapters/cloudflare-pages/vite/index.mjs +46 -67
- package/lib/adapters/deno-server/vite/index.mjs +25 -39
- package/lib/adapters/netlify-edge/vite/index.mjs +50 -76
- package/lib/adapters/node-server/vite/index.mjs +16 -22
- package/lib/adapters/shared/vite/index.mjs +271 -360
- package/lib/adapters/ssg/vite/index.mjs +11 -15
- package/lib/adapters/vercel-edge/vite/index.mjs +74 -95
- package/lib/chunks/dev-preloaded-route-loader.mjs +2 -3
- package/lib/chunks/format.mjs +16 -23
- package/lib/chunks/fs.mjs +93 -106
- package/lib/chunks/head.qwik.mjs +1174 -1382
- package/lib/chunks/http-error.qwik.mjs +20 -28
- package/lib/chunks/pathname.mjs +50 -69
- package/lib/chunks/request-body-limit.mjs +25 -35
- package/lib/chunks/request-path.mjs +44 -55
- package/lib/chunks/routes.mjs +20 -41
- package/lib/chunks/server-error.mjs +15 -18
- package/lib/chunks/system.mjs +258 -326
- package/lib/chunks/url.mjs +56 -58
- package/lib/chunks/user-response.mjs +1616 -1804
- package/lib/chunks/worker-thread.mjs +254 -307
- package/lib/index.qwik.mjs +1637 -1918
- package/lib/middleware/aws-lambda/index.mjs +44 -52
- package/lib/middleware/azure-swa/index.mjs +85 -94
- package/lib/middleware/bun/index.mjs +118 -138
- package/lib/middleware/cloudflare-pages/index.mjs +83 -96
- package/lib/middleware/deno/index.mjs +104 -125
- package/lib/middleware/firebase/index.mjs +21 -25
- package/lib/middleware/netlify-edge/index.mjs +63 -71
- package/lib/middleware/node/index.mjs +297 -357
- package/lib/middleware/request-handler/index.mjs +110 -133
- package/lib/middleware/vercel-edge/index.mjs +82 -98
- package/lib/service-worker/index.mjs +12 -3
- package/lib/ssg/index.mjs +249 -289
- package/lib/vite/index.mjs +2344 -3030
- package/package.json +5 -5
- package/lib/chunks/use-functions.qwik.mjs +0 -23
|
@@ -1,56 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
scriptFile: azureSwaModulePath
|
|
47
|
-
}, null, 2);
|
|
48
|
-
await fs.promises.writeFile(funcJsonPath, funcJson);
|
|
49
|
-
if (!fs.existsSync(join(clientPublicOutDir, "index.html"))) {
|
|
50
|
-
await fs.promises.writeFile(join(clientPublicOutDir, "index.html"), "");
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
1
|
+
import { viteAdapter } from "../../shared/vite/index.mjs";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
/** @public */ function azureSwaAdapter(opts = {}) {
|
|
5
|
+
const env = process?.env;
|
|
6
|
+
return viteAdapter({
|
|
7
|
+
name: "azure-swa",
|
|
8
|
+
origin: env?.ORIGIN ?? env?.URL ?? "https://yoursitename.region.2.azurestaticapps.net",
|
|
9
|
+
ssg: opts.ssg,
|
|
10
|
+
cleanStaticGenerated: true,
|
|
11
|
+
async generate({ outputEntries, serverOutDir, clientPublicOutDir }) {
|
|
12
|
+
const serverPackageJsonPath = join(serverOutDir, "package.json");
|
|
13
|
+
const serverPackageJsonCode = `{"type":"module"}`;
|
|
14
|
+
await fs.promises.mkdir(serverOutDir, { recursive: true });
|
|
15
|
+
await fs.promises.writeFile(serverPackageJsonPath, serverPackageJsonCode);
|
|
16
|
+
const azureSwaModulePath = outputEntries.find((entryName) => entryName.indexOf("entry.azure-swa") === 0);
|
|
17
|
+
const funcJsonPath = join(serverOutDir, "function.json");
|
|
18
|
+
const funcJson = JSON.stringify({
|
|
19
|
+
bindings: [{
|
|
20
|
+
authLevel: "anonymous",
|
|
21
|
+
type: "httpTrigger",
|
|
22
|
+
direction: "in",
|
|
23
|
+
name: "req",
|
|
24
|
+
methods: [
|
|
25
|
+
"get",
|
|
26
|
+
"head",
|
|
27
|
+
"post",
|
|
28
|
+
"put",
|
|
29
|
+
"delete",
|
|
30
|
+
"connect",
|
|
31
|
+
"options",
|
|
32
|
+
"trace",
|
|
33
|
+
"patch"
|
|
34
|
+
]
|
|
35
|
+
}, {
|
|
36
|
+
type: "http",
|
|
37
|
+
direction: "out",
|
|
38
|
+
name: "$return"
|
|
39
|
+
}],
|
|
40
|
+
scriptFile: azureSwaModulePath
|
|
41
|
+
}, null, 2);
|
|
42
|
+
await fs.promises.writeFile(funcJsonPath, funcJson);
|
|
43
|
+
if (!fs.existsSync(join(clientPublicOutDir, "index.html"))) await fs.promises.writeFile(join(clientPublicOutDir, "index.html"), "");
|
|
44
|
+
}
|
|
45
|
+
});
|
|
54
46
|
}
|
|
55
|
-
|
|
56
47
|
export { azureSwaAdapter };
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import { viteAdapter } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
publicDir: false
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
});
|
|
1
|
+
import { viteAdapter } from "../../shared/vite/index.mjs";
|
|
2
|
+
/** @beta */ function bunServerAdapter(opts = {}) {
|
|
3
|
+
const env = process?.env;
|
|
4
|
+
return viteAdapter({
|
|
5
|
+
name: opts.name || "bun-server",
|
|
6
|
+
origin: env?.ORIGIN ?? env?.URL ?? "https://yoursitename.qwik.dev",
|
|
7
|
+
ssg: opts.ssg,
|
|
8
|
+
cleanStaticGenerated: true,
|
|
9
|
+
config() {
|
|
10
|
+
return {
|
|
11
|
+
ssr: { target: "node" },
|
|
12
|
+
build: { ssr: true },
|
|
13
|
+
publicDir: false
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
});
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
export { bunServerAdapter };
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { viteAdapter } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
});
|
|
1
|
+
import { viteAdapter } from "../../shared/vite/index.mjs";
|
|
2
|
+
/** @public */ function cloudRunAdapter(opts = {}) {
|
|
3
|
+
const env = process?.env;
|
|
4
|
+
return viteAdapter({
|
|
5
|
+
name: "cloud-run",
|
|
6
|
+
origin: env?.ORIGIN ?? env?.URL ?? "https://your-app-name.run.app",
|
|
7
|
+
ssg: opts.ssg,
|
|
8
|
+
cleanStaticGenerated: true,
|
|
9
|
+
config() {
|
|
10
|
+
return {
|
|
11
|
+
build: { ssr: true },
|
|
12
|
+
publicDir: false
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
});
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
export { cloudRunAdapter };
|
|
@@ -1,69 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const routesJson = {
|
|
48
|
-
version: 1,
|
|
49
|
-
include: [
|
|
50
|
-
basePathname + "*"
|
|
51
|
-
],
|
|
52
|
-
exclude: [
|
|
53
|
-
pathName + "build/*",
|
|
54
|
-
pathName + "assets/*"
|
|
55
|
-
]
|
|
56
|
-
};
|
|
57
|
-
await fs.promises.writeFile(routesJsonPath, JSON.stringify(routesJson, void 0, 2));
|
|
58
|
-
}
|
|
59
|
-
const workerJsPath = join(clientOutDir, "_worker.js");
|
|
60
|
-
const hasWorkerJs = fs.existsSync(workerJsPath);
|
|
61
|
-
if (!hasWorkerJs) {
|
|
62
|
-
const importPath = relative(clientOutDir, join(serverOutDir, "entry.cloudflare-pages"));
|
|
63
|
-
await fs.promises.writeFile(workerJsPath, `import { fetch } from "${normalizePathSlash(importPath)}"; export default { fetch };`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
});
|
|
1
|
+
import { t as ensureSlash } from "../../../chunks/pathname.mjs";
|
|
2
|
+
import { viteAdapter } from "../../shared/vite/index.mjs";
|
|
3
|
+
import { v as normalizePathSlash } from "../../../chunks/fs.mjs";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import { join, relative } from "node:path";
|
|
6
|
+
/** @public */ function cloudflarePagesAdapter(opts = {}) {
|
|
7
|
+
const env = process?.env;
|
|
8
|
+
return viteAdapter({
|
|
9
|
+
name: "cloudflare-pages",
|
|
10
|
+
origin: env?.CF_PAGES_URL ?? env?.ORIGIN ?? "https://your.cloudflare.pages.dev",
|
|
11
|
+
ssg: opts.ssg,
|
|
12
|
+
staticPaths: opts.staticPaths,
|
|
13
|
+
cleanStaticGenerated: true,
|
|
14
|
+
config() {
|
|
15
|
+
return {
|
|
16
|
+
resolve: { conditions: ["webworker", "worker"] },
|
|
17
|
+
ssr: {
|
|
18
|
+
target: "webworker",
|
|
19
|
+
noExternal: true,
|
|
20
|
+
external: ["node:async_hooks"]
|
|
21
|
+
},
|
|
22
|
+
build: {
|
|
23
|
+
ssr: true,
|
|
24
|
+
rolldownOptions: { output: { format: "es" } }
|
|
25
|
+
},
|
|
26
|
+
publicDir: false
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
async generate({ clientOutDir, serverOutDir, basePathname }) {
|
|
30
|
+
const routesJsonPath = join(clientOutDir, "_routes.json");
|
|
31
|
+
if (!fs.existsSync(routesJsonPath) && opts.functionRoutes !== false) {
|
|
32
|
+
const pathName = ensureSlash(basePathname);
|
|
33
|
+
const routesJson = {
|
|
34
|
+
version: 1,
|
|
35
|
+
include: [basePathname + "*"],
|
|
36
|
+
exclude: [pathName + "build/*", pathName + "assets/*"]
|
|
37
|
+
};
|
|
38
|
+
await fs.promises.writeFile(routesJsonPath, JSON.stringify(routesJson, void 0, 2));
|
|
39
|
+
}
|
|
40
|
+
const workerJsPath = join(clientOutDir, "_worker.js");
|
|
41
|
+
if (!fs.existsSync(workerJsPath)) {
|
|
42
|
+
const importPath = relative(clientOutDir, join(serverOutDir, "entry.cloudflare-pages"));
|
|
43
|
+
await fs.promises.writeFile(workerJsPath, `import { fetch } from "${normalizePathSlash(importPath)}"; export default { fetch };`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
67
47
|
}
|
|
68
|
-
|
|
69
48
|
export { cloudflarePagesAdapter };
|
|
@@ -1,41 +1,27 @@
|
|
|
1
|
-
import { viteAdapter } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
ssr: true,
|
|
27
|
-
target: "esnext",
|
|
28
|
-
rollupOptions: {
|
|
29
|
-
output: {
|
|
30
|
-
format: "es",
|
|
31
|
-
hoistTransitiveImports: false
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
publicDir: false
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
});
|
|
1
|
+
import { viteAdapter } from "../../shared/vite/index.mjs";
|
|
2
|
+
/** @beta */ function denoServerAdapter(opts = {}) {
|
|
3
|
+
const env = process?.env;
|
|
4
|
+
return viteAdapter({
|
|
5
|
+
name: opts.name || "deno-server",
|
|
6
|
+
origin: env?.ORIGIN ?? env?.URL ?? "https://yoursitename.qwik.dev",
|
|
7
|
+
ssg: opts.ssg,
|
|
8
|
+
cleanStaticGenerated: true,
|
|
9
|
+
config() {
|
|
10
|
+
return {
|
|
11
|
+
resolve: { conditions: ["webworker", "worker"] },
|
|
12
|
+
ssr: {
|
|
13
|
+
target: "webworker",
|
|
14
|
+
noExternal: true,
|
|
15
|
+
external: ["node:async_hooks"]
|
|
16
|
+
},
|
|
17
|
+
build: {
|
|
18
|
+
ssr: true,
|
|
19
|
+
target: "esnext",
|
|
20
|
+
rolldownOptions: { output: { format: "es" } }
|
|
21
|
+
},
|
|
22
|
+
publicDir: false
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
39
26
|
}
|
|
40
|
-
|
|
41
27
|
export { denoServerAdapter };
|
|
@@ -1,78 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
const netlifyEdgeManifest = {
|
|
53
|
-
functions: [
|
|
54
|
-
{
|
|
55
|
-
path: basePathname + "*",
|
|
56
|
-
function: "entry.netlify-edge",
|
|
57
|
-
cache: "manual",
|
|
58
|
-
excludedPath
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
version: 1
|
|
62
|
-
};
|
|
63
|
-
const jsPath = join(serverOutDir, "entry.netlify-edge.js");
|
|
64
|
-
const mjsPath = join(serverOutDir, "entry.netlify-edge.mjs");
|
|
65
|
-
if (existsSync(mjsPath)) {
|
|
66
|
-
await fs.promises.writeFile(jsPath, [
|
|
67
|
-
`import entry_netlifyEdge from './entry.netlify-edge.mjs';`,
|
|
68
|
-
`export default entry_netlifyEdge;`
|
|
69
|
-
].join("\n"));
|
|
70
|
-
}
|
|
71
|
-
const netlifyEdgeFnsDir = getParentDir(serverOutDir, "edge-functions");
|
|
72
|
-
await fs.promises.writeFile(join(netlifyEdgeFnsDir, "manifest.json"), JSON.stringify(netlifyEdgeManifest, null, 2));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
});
|
|
1
|
+
import { getParentDir, viteAdapter } from "../../shared/vite/index.mjs";
|
|
2
|
+
import fs, { existsSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
/** @public */ function netlifyEdgeAdapter(opts = {}) {
|
|
5
|
+
const env = process?.env;
|
|
6
|
+
return viteAdapter({
|
|
7
|
+
name: "netlify-edge",
|
|
8
|
+
origin: env?.ORIGIN ?? env?.URL ?? "https://yoursitename.netlify.app",
|
|
9
|
+
ssg: opts.ssg,
|
|
10
|
+
staticPaths: opts.staticPaths,
|
|
11
|
+
cleanStaticGenerated: true,
|
|
12
|
+
config(config) {
|
|
13
|
+
return {
|
|
14
|
+
resolve: { conditions: ["webworker", "worker"] },
|
|
15
|
+
ssr: {
|
|
16
|
+
target: "webworker",
|
|
17
|
+
noExternal: true,
|
|
18
|
+
external: ["node:async_hooks"]
|
|
19
|
+
},
|
|
20
|
+
build: {
|
|
21
|
+
ssr: true,
|
|
22
|
+
outDir: config.build?.outDir || ".netlify/edge-functions/entry.netlify-edge",
|
|
23
|
+
rolldownOptions: { output: { format: "es" } }
|
|
24
|
+
},
|
|
25
|
+
publicDir: false
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
async generate({ serverOutDir, basePathname }) {
|
|
29
|
+
if (opts.functionRoutes !== false) {
|
|
30
|
+
const excludedPath = [];
|
|
31
|
+
if (typeof opts.excludedPath === "string") excludedPath.push(opts.excludedPath);
|
|
32
|
+
else if (Array.isArray(opts.excludedPath)) excludedPath.push(...opts.excludedPath);
|
|
33
|
+
else excludedPath.push("/build/*", "/favicon.ico", "/robots.txt", "/mainifest.json", "/~partytown/*", "/service-worker.js", "/sitemap.xml");
|
|
34
|
+
const netlifyEdgeManifest = {
|
|
35
|
+
functions: [{
|
|
36
|
+
path: basePathname + "*",
|
|
37
|
+
function: "entry.netlify-edge",
|
|
38
|
+
cache: "manual",
|
|
39
|
+
excludedPath
|
|
40
|
+
}],
|
|
41
|
+
version: 1
|
|
42
|
+
};
|
|
43
|
+
const jsPath = join(serverOutDir, "entry.netlify-edge.js");
|
|
44
|
+
const mjsPath = join(serverOutDir, "entry.netlify-edge.mjs");
|
|
45
|
+
if (existsSync(mjsPath)) await fs.promises.writeFile(jsPath, [`import entry_netlifyEdge from './entry.netlify-edge.mjs';`, `export default entry_netlifyEdge;`].join("\n"));
|
|
46
|
+
const netlifyEdgeFnsDir = getParentDir(serverOutDir, "edge-functions");
|
|
47
|
+
await fs.promises.writeFile(join(netlifyEdgeFnsDir, "manifest.json"), JSON.stringify(netlifyEdgeManifest, null, 2));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
76
51
|
}
|
|
77
|
-
|
|
78
52
|
export { netlifyEdgeAdapter };
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import { viteAdapter } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
publicDir: false
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
});
|
|
1
|
+
import { viteAdapter } from "../../shared/vite/index.mjs";
|
|
2
|
+
/** @beta */ function nodeServerAdapter(opts = {}) {
|
|
3
|
+
const env = process?.env;
|
|
4
|
+
return viteAdapter({
|
|
5
|
+
name: opts.name || "node-server",
|
|
6
|
+
origin: env?.ORIGIN ?? env?.URL ?? "https://yoursitename.qwik.dev",
|
|
7
|
+
ssg: opts.ssg,
|
|
8
|
+
cleanStaticGenerated: true,
|
|
9
|
+
config() {
|
|
10
|
+
return {
|
|
11
|
+
ssr: { target: "node" },
|
|
12
|
+
build: { ssr: true },
|
|
13
|
+
publicDir: false
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
});
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
export { nodeServerAdapter };
|