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: docs/guide/plugins-and-presets.md
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -180,7 +180,13 @@ For such scenarios you can specify `"prompts": true` in a plugin's options to al
180
180
181
181
### Remote Presets
182
182
183
-
You can share a preset with other developers by publishing it in a git repo. The repo should contain a `preset.json` file containing the preset data. You can then use the `--preset` option to use the remote preset when creating a project:
183
+
You can share a preset with other developers by publishing it in a git repo. The repo can contain the following files:
184
+
185
+
-`preset.json`: the main file containing the preset data (required).
186
+
-`generator.js`: a [Generator](../dev-guide/plugin-dev.md#generator) that can inject or modify files in the project.
187
+
-`prompts.js`: a [prompts file](../dev-guide/plugin-dev.md#prompts-for-3rd-party-plugins) that can collect options for the generator.
188
+
189
+
Once the repo is published, you can then use the `--preset` option to use the remote preset when creating a project:
When developing a remote preset, it can be tedious to have to repeatedly push the preset to a remote repo to test it. To simplify the workflow, the `--preset`flag also accepts local `.json` files:
205
+
When developing a remote preset, it can be tedious to have to repeatedly push the preset to a remote repo to test it. To simplify the workflow, you can directly work with local presets. Vue CLI will load local presets if the value for the `--preset`option is a relative or absolute file path, or ends with `.json`:
200
206
201
207
```bash
202
-
vue create --preset local.json my-project
208
+
# ./my-preset should be a directory containing preset.json
0 commit comments