Skip to content

Commit

Permalink
fix: don't set outDir when used with Astro (withastro/astro#5211)
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Nov 24, 2022
1 parent 7172898 commit 6ed9990
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions telefunc/utils/getOutDirs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,18 @@ function getOutDirs(config: ResolvedConfig): OutDirs {

/** Appends `client/` or `server/` to `config.build.outDir` */
function determineOutDir(config: ResolvedConfig): string | null {
// https://github.com/withastro/astro/issues/5211#issuecomment-1326084151
if (config.plugins.some((p) => p.name?.startsWith('astro:'))) return null

const outDirRoot = toPosixPath(config.build.outDir)
assertPosixPath(outDirRoot)

// When using vite-plugin-ssr and SvelteKit then `config.build.outDir` is already set
if (!isOutDirRoot(outDirRoot)) {
assertConfig(config)
return null
}

const { outDirClient, outDirServer } = declineOutDirs(outDirRoot)
if (viteIsSSR(config)) {
return outDirServer
Expand Down

0 comments on commit 6ed9990

Please sign in to comment.