You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/vite_task/docs/rfc-add-remove-package-commands.md
+42-18Lines changed: 42 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ vite add -D typescript @types/react
75
75
vite add react -E
76
76
77
77
# Add peer dependency
78
-
vite add -P react
78
+
vite add --save-peer react
79
79
80
80
# Add optional dependency
81
81
vite add -O sharp
@@ -88,6 +88,18 @@ vite add react --filter "app*" # Add to multiple packages (pattern)
88
88
vite add utils --filter "!@myorg/core"# Exclude packages
89
89
```
90
90
91
+
##### `vite install` Command with `PACKAGES` arguments
92
+
93
+
To accommodate the user habits and experience of `npm install <PACKAGES>…`, `vite install <PACKAGES>...` will be specially treated as an alias for the add command.
94
+
95
+
The following commands will be automatically converted to the add command for processing:
96
+
97
+
```bash
98
+
vite install <PACKAGES>... [OPTIONS]
99
+
100
+
-> vite add <PACKAGES>... [OPTIONS]
101
+
```
102
+
91
103
#### Remove Command
92
104
93
105
```bash
@@ -117,28 +129,40 @@ vite remove -g typescript # Remove global package
|`--save-catalog`|`--save-catalog`|`--save-catalog`| N/A | Save the new dependency to the default catalog |
149
+
|`--save-catalog-name <catalog_name>`| SAME | N/A | N/A | Save the new dependency to the specified catalog |
150
+
|`--allow-build <names>`| SAME | N/A | N/A | A list of package names allowed to run postinstall |
131
151
132
152
**Note**: For pnpm, `--filter` must come before the command (e.g., `pnpm --filter app add react`). For yarn/npm, it's integrated into the command structure.
0 commit comments