What problem does this feature solve?
webpack supports Alternatives in package.json#exports fields: https://webpack.js.org/guides/package-exports/#alternatives
This allows us to import from one path, if possible, and fallback to another path if required. Currently in rspack, this will fail with a Failed to resolve in case the first occurance (./dist/index.js) does not exist. It works in webpack however.
"exports": {
".": {
"types": [
"./dist/index.d.ts",
"./src/index.ts"
],
"import": [
"./dist/index.js",
"./src/index.ts"
]
}
}
What does the proposed API of configuration look like?
No API required.
What problem does this feature solve?
webpack supports Alternatives in package.json#exports fields: https://webpack.js.org/guides/package-exports/#alternatives
This allows us to import from one path, if possible, and fallback to another path if required. Currently in rspack, this will fail with a
Failed to resolvein case the first occurance (./dist/index.js) does not exist. It works in webpack however.What does the proposed API of configuration look like?
No API required.