Skip to content

Commit

Permalink
fix: stop assuming UserConfig.build.outDir to be a posix path
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Oct 26, 2022
1 parent e0c147e commit 013c2fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions telefunc/utils/getOutDirs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { UserConfig, ResolvedConfig } from 'vite'
import { viteIsSSR } from './viteIsSSR'
import { assert } from './assert'
import { assertPosixPath } from './filesystemPathHandling'
import { assertPosixPath, toPosixPath } from './filesystemPathHandling'
import path from 'path'

export { getOutDirs }
Expand Down Expand Up @@ -35,7 +35,7 @@ function getOutDirs_prerender(config: ResolvedConfig): OutDirs {

/** Appends `client/` or `server/` to `config.build.outDir` */
function determineOutDir(config: UserConfig): string {
let outDirRoot = config.build?.outDir || 'dist'
const outDirRoot = toPosixPath(config.build?.outDir || 'dist')
assertPosixPath(outDirRoot)
// When using Telefunc + vite-plugin-ssr then `config.build.outDir` may already be set
if (!isOutDirRoot(outDirRoot)) {
Expand Down

0 comments on commit 013c2fc

Please sign in to comment.