You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They are not in the ECMAScript spec as opposed to ESModules [3][4] for which support is being built into browsers[4] and Node[5]
What I propose is to use the main and module field in package.json to provide both ESM and CommonJS. This change is fully backwards compatible and can be achieved by using TypeScript, Webpack, or Rollup. I'd propose to go the TypeScript way which has the added benefit of type safety and allows ms to bundle types.
If you would accept this I could make a PR.
The text was updated successfully, but these errors were encountered:
Currently,
ms
is written in CommonJS. This has some drawbacks:esModuleInterop
for TypeScript [2]What I propose is to use the
main
andmodule
field inpackage.json
to provide both ESM and CommonJS. This change is fully backwards compatible and can be achieved by using TypeScript, Webpack, or Rollup. I'd propose to go the TypeScript way which has the added benefit of type safety and allowsms
to bundle types.If you would accept this I could make a PR.
The text was updated successfully, but these errors were encountered: