Open hanayashiki opened 1 year ago
Many packages started supporting package exports because that is one way to support pure ESModules. Here is an example repo that showcases that it passes esbuild/webpack but fails with swc.
@mohamedmansour What are you trying to do? Are you trying to use swcpack
? I don't think it's a good idea.
@mohamedmansour What are you trying to do? Are you trying to use
swcpack
? I don't think it's a good idea.
I was following this https://swc.rs/docs/usage/bundling, I wanted to replace webpack with either esbuild or swc.
I added some more context about the status of swcpack
to https://swc.rs/docs/usage/bundling
Describe the feature
Right now subpath exports is around there for a while, and a number of packages are using them to handle conditional cjs/esm exports, so that both platforms are supported.
It seems SWC doesn't support this feature in
NodeModulesResolver
yet.Source
In the definition of
PackageJson
, there are no definitions ofexports
, so I assume this feature is not quite there yet.I wish this could be handled in the future.
Babel plugin or link to the feature description
No response
Additional context
No response