Skip to content

Commit

Permalink
refactor(cjs): type extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed May 29, 2024
1 parent f30b296 commit 39507b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cjs/api/module-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down

0 comments on commit 39507b8

Please sign in to comment.