Skip to content

Commit 8b10a96

Browse files
authored
chore(vite): suppress EVAL warnings from @prisma/internals (#1834)
1 parent d83b4c2 commit 8b10a96

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

packages/vite/src/buildApp.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,22 +88,35 @@ export async function buildCedarApp({
8888
external: (id: string) => {
8989
if (id.startsWith('node:')) {
9090
return true
91-
}
92-
if (!id.startsWith('.') && !path.isAbsolute(id)) {
91+
} else if (!id.startsWith('.') && !path.isAbsolute(id)) {
9392
return true
9493
}
94+
9595
return false
9696
},
97-
// graphql-scalars places `/*#__PURE__*/` on object literal exports
98-
// which Rollup can't interpret (only valid before call/new expressions).
99-
// Tracked upstream: https://github.com/graphql-hive/graphql-scalars/issues/2869
10097
onwarn(warning, warn) {
98+
// Prisma internals uses `eval()` for path resolution which Rollup
99+
// warns about. The code is safe and works correctly at runtime.
100+
// Tracked upstream: https://github.com/prisma/prisma/issues/20752
101+
if (
102+
warning.code === 'EVAL' &&
103+
warning.id?.includes('@prisma/internals')
104+
) {
105+
return
106+
}
107+
108+
// graphql-scalars places `/*#__PURE__*/` on object literal exports
109+
// which Rollup can't interpret (only valid before call/new
110+
// expressions).
111+
// Tracked upstream:
112+
// https://github.com/graphql-hive/graphql-scalars/issues/2869
101113
if (
102114
warning.code === 'INVALID_ANNOTATION' &&
103115
warning.id?.includes('graphql-scalars')
104116
) {
105117
return
106118
}
119+
107120
warn(warning)
108121
},
109122
},

0 commit comments

Comments
 (0)