swagger-js
swagger-js copied to clipboard
Convert swagger-client to ESM
Node.js world has moved to native ESM support some time ago. Wee need to get on this train to be able to used ESM or CommonJS packages. If we maintain status quo, we can only use older CommonJS packages.
Resources:
- https://nodejs.org/docs/latest-v16.x/api/esm.html
- https://nodejs.org/docs/latest-v16.x/api/packages.html
We already have explicit usage of file extension that was introduced in https://github.com/swagger-api/swagger-js/pull/2320.
We need to add "type": "module" to the package.json as well.
This change should be fully compatible so we should still be using older package fields like main
or browser
along with new exports
.