Skip to content

Commit

Permalink
fix: properly handle absolute outdir. Fixes #38
Browse files Browse the repository at this point in the history
  • Loading branch information
magne4000 committed Dec 23, 2024
1 parent 96e1670 commit d66ba1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/vike-node/src/plugin/plugins/edgePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function edgePlugin(): Plugin[] {
viteConfig = config
root = toPosixPath(config.root)
outDir = toPosixPath(config.build.outDir)
outDirAbs = path.posix.join(root, outDir)
outDirAbs = path.isAbsolute(outDir) ? outDir : path.posix.join(root, outDir)

// Now that outDirAbs is available, we can create entriesWithOutFile
entriesWithOutFile = entries.map((entry) => ({
Expand Down
6 changes: 3 additions & 3 deletions packages/vike-node/src/plugin/plugins/standalonePlugin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path'
import esbuild from 'esbuild'
import fs from 'fs/promises'
import path from 'path'
import { searchForWorkspaceRoot, type Plugin, type ResolvedConfig } from 'vite'
import { type Plugin, type ResolvedConfig, searchForWorkspaceRoot } from 'vite'
import type { ConfigVikeNodeResolved } from '../../types.js'
import { assert, assertUsage } from '../../utils/assert.js'
import { toPosixPath } from '../utils/filesystemPathHandling.js'
Expand Down Expand Up @@ -37,7 +37,7 @@ export function standalonePlugin(): Plugin {
if (!enabled) return
root = toPosixPath(config.root)
outDir = toPosixPath(config.build.outDir)
outDirAbs = path.posix.join(root, outDir)
outDirAbs = path.isAbsolute(outDir) ? outDir : path.posix.join(root, outDir)
},
buildStart() {
if (!enabled) return
Expand Down

0 comments on commit d66ba1a

Please # to comment.