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: README.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,6 @@
16
16
</a>
17
17
</p>
18
18
19
-
20
19
<br>
21
20
22
21
## Usage
@@ -36,11 +35,11 @@ import ViteComponents from 'vite-plugin-components'
36
35
exportdefault {
37
36
plugins: [
38
37
ViteComponents()
39
-
]
40
-
}
38
+
],
39
+
};
41
40
```
42
41
43
-
That's all.
42
+
That's all.
44
43
45
44
Use components in templates as you would usually do but NO `import` and `component registration` required anymore! It will import components on demand, code splitting is also possible.
46
45
@@ -89,11 +88,18 @@ The following show the default values of the configuration
89
88
ViteComponents({
90
89
// relative paths to the directory to search for components.
91
90
dirs: ['src/components'],
91
+
92
92
// valid file extensions for components.
93
93
extensions: ['vue'],
94
94
// search for subdirectories
95
95
deep: true,
96
96
97
+
// Allow subdirectories as namespace prefix for components.
98
+
directoryAsNamespace: false,
99
+
// Subdirectory paths for ignoring namespace prefixes
100
+
// works when `directoryAsNamespace: true`
101
+
globalNamespaces: [],
102
+
97
103
// vite config
98
104
// currently, vite does not provide an API for plugins to get the config https://github.com/vitejs/vite/issues/738
99
105
// you will need to pass `alias` and `root` if you set them in vite config
0 commit comments