Skip to content

Commit b89ddd6

Browse files
authoredJan 4, 2023
fix: remove moment from force interop packages (#11502)
1 parent a802828 commit b89ddd6

File tree

1 file changed

+1
-9
lines changed
  • packages/vite/src/node/optimizer

1 file changed

+1
-9
lines changed
 

‎packages/vite/src/node/optimizer/index.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -997,22 +997,14 @@ export async function extractExportsData(
997997
return exportsData
998998
}
999999

1000-
// https://github.com/vitejs/vite/issues/1724#issuecomment-767619642
1001-
// a list of modules that pretends to be ESM but still uses `require`.
1002-
// this causes esbuild to wrap them as CJS even when its entry appears to be ESM.
1003-
const KNOWN_INTEROP_IDS = new Set(['moment'])
1004-
10051000
function needsInterop(
10061001
config: ResolvedConfig,
10071002
ssr: boolean,
10081003
id: string,
10091004
exportsData: ExportsData,
10101005
output?: { exports: string[] },
10111006
): boolean {
1012-
if (
1013-
getDepOptimizationConfig(config, ssr)?.needsInterop?.includes(id) ||
1014-
KNOWN_INTEROP_IDS.has(id)
1015-
) {
1007+
if (getDepOptimizationConfig(config, ssr)?.needsInterop?.includes(id)) {
10161008
return true
10171009
}
10181010
const { hasImports, exports } = exportsData

0 commit comments

Comments
 (0)
Please sign in to comment.