I try use npm 7 workspaces
"workspaces": {
"packages": [
"packages/apps/*",
"packages/components",
],
and after install I see in my package.json
"dependencies": {
"@project/components": "file:workspaces/components",
Is it correct ? And what is mean file: ?
https://github.com/ruanmartinelli/npm-workspaces-demo Check out this demo.I think this would clear your doubts
Workspaces is a generic term that refers to the set of features in the npm CLI that provides support to managing multiple packages from your local files system from within a singular top-level, root package.
Defining workspaces
Workspaces are usually defined via the workspaces property of the package.json file, e.g:
{
"name": "my-workspaces-powered-project",
"workspaces": [
"workspace-a"
]
}
Given the above package.json example living at a current working directory . that contains a folder named workspace-a that itself contains a package.json inside it, defining a Node.js package, e.g:
.
+-- package.json
`-- workspace-a
`-- package.json