Skip to content

Commit 9759c29

Browse files
authored
fix(optimizer): align relative build.rollupOptions.input resolution with rollup (#20080)
1 parent 1ea2222 commit 9759c29

File tree

1 file changed

+8
-3
lines changed
  • packages/vite/src/node/optimizer

1 file changed

+8
-3
lines changed

packages/vite/src/node/optimizer/scan.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,15 @@ async function computeEntries(environment: ScanEnvironment) {
231231
entries = await globEntries(explicitEntryPatterns, environment)
232232
} else if (buildInput) {
233233
const resolvePath = async (p: string) => {
234+
// rollup resolves the input from process.cwd()
234235
const id = (
235-
await environment.pluginContainer.resolveId(p, undefined, {
236-
scan: true,
237-
})
236+
await environment.pluginContainer.resolveId(
237+
p,
238+
path.join(process.cwd(), '*'),
239+
{
240+
scan: true,
241+
},
242+
)
238243
)?.id
239244
if (id === undefined) {
240245
throw new Error(

0 commit comments

Comments
 (0)