mirror of
https://github.com/denoland/deno.git
synced 2024-12-12 10:37:52 -05:00
9534e6e113
This commit adds unstable workspace support. This is extremely bare-bones and minimal first-pass at this. With this change `deno.json` supports specifying `workspaces` key, that accepts a list of subdirectories. Each workspace can have its own import map. It's required to specify a `"name"` and `"version"` properties in the configuration file for the workspace: ```jsonc // deno.json { "workspaces": [ "a", "b" }, "imports": { "express": "npm:express@5" } } ``` ``` jsonc // a/deno.json { "name": "a", "version": "1.0.2", "imports": { "kleur": "npm:kleur" } } ``` ```jsonc // b/deno.json { "name": "b", "version": "0.51.0", "imports": { "chalk": "npm:chalk" } } ``` `--unstable-workspaces` flag is required to use this feature: ``` $ deno run --unstable-workspaces mod.ts ``` --------- Co-authored-by: David Sherret <dsherret@gmail.com>
21 lines
No EOL
371 B
Text
21 lines
No EOL
371 B
Text
[WILDCARD]Workspace config generated this import map {
|
|
"imports": {
|
|
"chalk": "npm:chalk"
|
|
},
|
|
"scopes": {
|
|
"./foo/": {
|
|
"~/": "./foo/",
|
|
"foo/": "./foo/bar/"
|
|
},
|
|
"./bar/": {
|
|
"@/": "./bar/",
|
|
"secret_mod/": "./bar/some_mod/"
|
|
}
|
|
}
|
|
}
|
|
[WILDCARD]
|
|
hello from foo
|
|
buzz from foo
|
|
hello from bar
|
|
buzz from bar
|
|
[Function: chalk][WILDCARD] |