Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zeabur): support zeaburStatic and auto detect preset #2014

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/presets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ export { iis, iisHandler, iisNode } from "./iis";
export { _static as static } from "./static";
export { githubPages } from "./github-pages";
export { winterjs } from "./winterjs";
export { zeabur } from "./zeabur";
export { zeabur, zeaburStatic } from "./zeabur";
11 changes: 11 additions & 0 deletions src/presets/zeabur.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,14 @@ export const zeabur = defineNitroPreset({
},
},
});

export const zeaburStatic = defineNitroPreset({
extends: "static",
output: {
dir: "{{ rootDir }}/.zeabur/output",
publicDir: "{{ output.dir }}/static",
},
commands: {
preview: "npx serve ./static",
},
});
2 changes: 2 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const autodetectableProviders: Partial<
stormkit: "stormkit",
vercel: "vercel",
cleavr: "cleavr",
zeabur: "zeabur",
};

const autodetectableStaticProviders: Partial<
Expand All @@ -119,6 +120,7 @@ const autodetectableStaticProviders: Partial<
netlify: "netlify-static",
vercel: "vercel-static",
cloudflare_pages: "cloudflare-pages-static",
zeabur: "zeabur-static",
};

export function detectTarget(options: { static?: boolean } = {}) {
Expand Down