package.json 中的“exports”属性在工作区中是否有效?

nic*_*_42 5 javascript node.js npm node-modules npm-workspaces

我有一个 npm 包设置如下

project
|
|-- package.json
|
|-- workspace_a
|   |-- package.json
|   |-- index.js
|
|-- workspace_b
|   |-- package.json
|   |
|   |-- src
|   |   |-- index.js
|   |   |
|   |   |-- folder_1
|   |   |   |-- index.js
|   |   |
|   |   |-- folder_2
|   |       |-- index.js
|   |
|   |-- dist
|       |-- index.js
|       |
|       |-- folder_1
|       |   |-- index.js
|       |
|       |-- folder_2
|           |-- index.js
Run Code Online (Sandbox Code Playgroud)

主项目文件已针对工作区进行了正确配置,工作区的project.json 文件也是如此。

project/workspace_b/package.json 包含以下内容:

{
  "main": "dist/index.js",
   "exports: {
     ".": "./dist/index.js",
     "./*": "./dist/*/*.js"
    }
}
Run Code Online (Sandbox Code Playgroud)

项目/workspace_a/index.js:

import example from "@project/workspace_b/folder_1"
Run Code Online (Sandbox Code Playgroud)

我希望这一行加载其中包含的默认导出,project/workspace_b/dist/folder_1/index.js但是我收到了错误Cannot find module: '@project/workspace_b/folder_1'

导出属性应该project/workspace_b/package.json为我处理这个问题吗?