Fix imports for @swagger-api/apidom-reference
`@swagger-api/apidom-reference` makes use of the `exports` field in `package.json`. This is a ESM/nodeJS specific spec, defined here: https://nodejs.org/docs/latest-v18.x/api/packages.html#exports It allows defining entrypoints for ESM packages. Webpack 4 doesn't support this part of the ESM spec, while Webpack 5 and Vite support it properly. It doesn't pose a problem usually, until the package starts using the defined entrypoints itself. The package `@swagger-api/apidom-reference` started to rely on it internally. So Vite handles it fine, but webpack needed some custom aliases. These aliases are used in vite as well, and broke vite. Instead of relying on aliases this implements a webpack 4 plugin which replaces the custom entry points with a proper link to the file. I really cannot wait for vite to replace webpack, so that we can get rid of this tech debt.
上级
466c5c80
No related branches found
No related tags found
加载中
想要评论请 注册 或 登录