Skip to content

Commit

Permalink
RSC: ensureProcessDirWeb()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Mar 4, 2024
1 parent b686470 commit 0f664d2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/vite/src/rsc/rscBuildClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { getPaths } from '@redwoodjs/project-config'

import { getEnvVarDefinitions } from '../envVarDefinitions'
import { onWarn } from '../lib/onWarn'
import { ensureProcessDirWeb } from '../utils'

import { rscIndexPlugin } from './rscVitePlugins'

Expand All @@ -23,6 +24,13 @@ export async function rscBuildClient(clientEntryFiles: Record<string, string>) {

const rwPaths = getPaths()

// Safe-guard for the future, if someone tries to include this function in
// code that gets executed by running `vite build` or some other bin from the
// cli
// Running the web build in the wrong working directory can lead to
// unintended consequences on CSS processing
ensureProcessDirWeb()

const clientBuildOutput = await viteBuild({
// configFile: viteConfigPath,
root: rwPaths.web.src,
Expand Down

0 comments on commit 0f664d2

Please sign in to comment.