blakeembrey / change-case

Convert strings between camelCase, PascalCase, Capital Case, snake_case and more
MIT License
2.26k stars 97 forks source link

Add 'require' Exports Option in package.json to Support CommonJS Modules in tsconfig #342

Closed hxtruong6 closed 4 months ago

hxtruong6 commented 4 months ago

This pull request adds the 'require' field to the exports option in the package.json file. This change is intended to solve issues with CommonJS module resolution when using TypeScript with tsconfig.json configured to use "module": "commonjs".

blakeembrey commented 4 months ago

This is an ESM package and cannot be required, that's why there's no require. Also I'm 99% sure it wouldn't fix your issue with module resolution either since the old Node10 resolution scheme doesn't look at this at all.