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

fix: ensure that esbuild uses the same working directory as Vite #4001

Merged
merged 2 commits into from Jun 30, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/vite/src/node/config.ts
Expand Up @@ -825,6 +825,7 @@ async function bundleConfigFile(
mjs = false
): Promise<{ code: string; dependencies: string[] }> {
const result = await build({
absWorkingDir: process.cwd(),
entryPoints: [fileName],
outfile: 'out.js',
write: false,
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/optimizer/index.ts
Expand Up @@ -261,6 +261,7 @@ export async function optimizeDeps(
config.optimizeDeps?.esbuildOptions ?? {}

const result = await build({
absWorkingDir: process.cwd(),
entryPoints: Object.keys(flatIdDeps),
bundle: true,
format: 'esm',
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/optimizer/scan.ts
Expand Up @@ -94,6 +94,7 @@ export async function scanImports(config: ResolvedConfig): Promise<{
await Promise.all(
entries.map((entry) =>
build({
absWorkingDir: process.cwd(),
write: false,
entryPoints: [entry],
bundle: true,
Expand Down