@@ -18,7 +18,11 @@ npm i -D unplugin-vue-named-export
1818import VueNamedExport from ' unplugin-vue-named-export/vite'
1919
2020export default defineConfig ({
21- plugins: [VueNamedExport ()],
21+ plugins: [
22+ VueNamedExport ({
23+ /* options */
24+ }),
25+ ],
2226})
2327```
2428
@@ -32,7 +36,11 @@ export default defineConfig({
3236import VueNamedExport from ' unplugin-vue-named-export/rollup'
3337
3438export default {
35- plugins: [VueNamedExport ()],
39+ plugins: [
40+ VueNamedExport ({
41+ /* options */
42+ }),
43+ ],
3644}
3745```
3846
@@ -46,7 +54,11 @@ export default {
4654import { build } from ' esbuild'
4755
4856build ({
49- plugins: [require (' unplugin-vue-named-export/esbuild' )()],
57+ plugins: [
58+ require (' unplugin-vue-named-export/esbuild' )({
59+ /* options */
60+ }),
61+ ],
5062})
5163```
5264
@@ -59,21 +71,11 @@ build({
5971// webpack.config.js
6072module .exports = {
6173 /* ... */
62- plugins: [require (' unplugin-vue-named-export/webpack' )()],
63- }
64- ```
65-
66- <br ></details >
67-
68- <details >
69- <summary >Vue CLI</summary ><br >
70-
71- ``` ts
72- // vue.config.js
73- module .exports = {
74- configureWebpack: {
75- plugins: [require (' unplugin-vue-named-export/webpack' )()],
76- },
74+ plugins: [
75+ require (' unplugin-vue-named-export/webpack' )({
76+ /* options */
77+ }),
78+ ],
7779}
7880```
7981
@@ -89,14 +91,41 @@ import { MyCard } from './my-card.vue'
8991import { MyFooter } from ' ./my_footer.vue'
9092```
9193
94+ ### Options
95+
96+ ``` ts
97+ type Options = {
98+ include? : string | RegExp | (string | RegExp )[]
99+ exclude? : string | RegExp | (string | RegExp )[]
100+
101+ /**
102+ * Convert filename to export name
103+ * @default pascalCaseFn
104+ */
105+ resolveName? (id : string ): string | Promise <string >
106+ /**
107+ * Whether to keep default export
108+ * @default false
109+ */
110+ removeDefault? : boolean
111+ }
112+ ` ` `
113+
92114### Volar
93115
116+ Support only pascal case named export for Volar.
117+
94118` ` ` jsonc
95119// tsconfig.json
96120{
97121 // ...
98122 " vueCompilerOptions" : {
99- " plugins" : [" unplugin-vue-named-export/volar" ]
123+ " plugins" : [" unplugin-vue-named-export/volar" ],
124+
125+ " namedExport" : {
126+ // defaults to false
127+ " removeDefault" : false
128+ }
100129 }
101130}
102131` ` `
0 commit comments