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/dev-guide/ui-api.md
+15-1Lines changed: 15 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ The cli-ui exposes an API that allows augmenting the project configurations and
6
6
7
7
## UI files
8
8
9
-
Inside each installed vue-cli plugins, the cli-ui will try to load an optional `ui.js` file in the root folder of the plugin. It will also try to load a `vue-cli-ui.js` file in the user project root so the UI can be manually extended on a per-project basis (also useful to quickly prototype a plugin). Note that you can also use folders (for example `ui/index.js`).
9
+
Inside each installed vue-cli plugins, the cli-ui will try to load an optional `ui.js` file in the root folder of the plugin. Note that you can also use folders (for example `ui/index.js`).
10
10
11
11
The file should export a function which gets the api object as argument:
12
12
@@ -30,6 +30,20 @@ Here is an example folder structure for a vue-cli plugin using the UI API:
30
30
- logo.png
31
31
```
32
32
33
+
### Project local plugins
34
+
35
+
If you need access to the plugin API in your project and don't want to create a full plugin for it, you can use the `vuePlugins.ui` option in your `package.json` file:
36
+
37
+
```json
38
+
{
39
+
"vuePlugins": {
40
+
"ui": ["my-ui.js"]
41
+
}
42
+
}
43
+
```
44
+
45
+
Each file will need to export a function taking the plugin API as the first argument.
46
+
33
47
## Dev mode
34
48
35
49
While building your plugin, you may want to run the cli-ui in Dev mode, so it will output useful logs to you:
Copy file name to clipboardExpand all lines: docs/guide/plugins-and-presets.md
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,17 @@ If you need access to the plugin API in your project and don't want to create a
89
89
90
90
Each file will need to export a function taking the plugin API as the first argument. For more information about the plugin API, check out the [Plugin Development Guide](../dev-guide/plugin-dev.md).
91
91
92
-
You can also create a `vue-cli-ui.js` file that will behave like a UI plugin. For more information, read the [UI Plugin API](../dev-guide/ui-api.md).
92
+
You can also add files that will behave like UI plugins with the `vuePlugins.ui` option:
93
+
94
+
```json
95
+
{
96
+
"vuePlugins": {
97
+
"ui": ["my-ui.js"]
98
+
}
99
+
}
100
+
```
101
+
102
+
For more information, read the [UI Plugin API](../dev-guide/ui-api.md).
0 commit comments