Closed wiidede closed 1 year ago
Hi.
resolve
method imported from path
/node:path
actually does not resolves a module path from node_modules
. It just concatinates current working directory to it's beginning.
module
field was an unstandard top level field used by bundlers (such as rollup, webpack, esbuild) to pick the bundler friendly ESM build. Native ESM only allows main
and exports
.
I have checked @arco-design/web-vue
package.json, please consider adding an export
field to package.json to properly work.
I understand. Thank you for your detailed explanation.
Environment
@types/node 20.9.1 mlly 1.4.2
Reproduction
https://stackblitz.com/~/github.com/wiidede/mlly-arco
Describe the bug
resolvePath's result is different from the module's path.
some package.json does not provide
exports
field.And the return value of resolvePath is
main
field. I think it should be themodule
field.import '@arco-design/web-vue'
console.log(resolvePathSync('@arco-design/web-vue'))
packageConfig
Additional context
No response
Logs
No response