Skip to content

Commit

Permalink
chore(pluginContainer): simplify error position judge condition (#12003)
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day committed Feb 11, 2023
1 parent d953536 commit e3ef9f4
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/vite/src/node/server/pluginContainer.ts
Expand Up @@ -385,13 +385,8 @@ export async function createPluginContainer(
if (ctx._activeCode) {
err.pluginCode = ctx._activeCode

const pos =
position != null
? position
: err.pos != null
? err.pos
: // some rollup plugins, e.g. json, sets position instead of pos
(err as any).position
// some rollup plugins, e.g. json, sets err.position instead of err.pos
const pos = position ?? err.pos ?? (err as any).position

if (pos != null) {
let errLocation
Expand Down

0 comments on commit e3ef9f4

Please sign in to comment.