diff --git a/src/cjs/api/module-extensions.ts b/src/cjs/api/module-extensions.ts index ed4d5ef11..dc6418dbe 100644 --- a/src/cjs/api/module-extensions.ts +++ b/src/cjs/api/module-extensions.ts @@ -14,16 +14,19 @@ const typescriptExtensions = [ '.ts', '.tsx', '.jsx', -]; +] as const; const transformExtensions = [ '.js', '.cjs', '.mjs', -]; +] as const; // Clone Module._extensions with null prototype -export const extensions = Object.assign(Object.create(null), Module._extensions); +export const extensions: NodeJS.RequireExtensions = Object.assign( + Object.create(null), + Module._extensions, +); const defaultLoader = extensions['.js'];