Skip to content

Commit e3ef9f4

Browse files
authored
chore(pluginContainer): simplify error position judge condition (#12003)
1 parent d953536 commit e3ef9f4

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

packages/vite/src/node/server/pluginContainer.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,8 @@ export async function createPluginContainer(
385385
if (ctx._activeCode) {
386386
err.pluginCode = ctx._activeCode
387387

388-
const pos =
389-
position != null
390-
? position
391-
: err.pos != null
392-
? err.pos
393-
: // some rollup plugins, e.g. json, sets position instead of pos
394-
(err as any).position
388+
// some rollup plugins, e.g. json, sets err.position instead of err.pos
389+
const pos = position ?? err.pos ?? (err as any).position
395390

396391
if (pos != null) {
397392
let errLocation

0 commit comments

Comments
 (0)