File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export default {
86
86
87
87
## Vue 2 Support
88
88
89
- From ` v0.7 ` , we support Vue 2 with [ ` vite-plugin-vue2 ` ] ( https://github.com/underfin/vite-plugin-vue2 )
89
+ It just works.
90
90
91
91
``` ts
92
92
// vite.config.js
@@ -96,9 +96,7 @@ import ViteComponents from 'vite-plugin-components'
96
96
export default {
97
97
plugins: [
98
98
createVuePlugin (),
99
- ViteComponents ({
100
- transformer: ' vue2' , // <--
101
- }),
99
+ ViteComponents (),
102
100
],
103
101
}
104
102
```
Original file line number Diff line number Diff line change @@ -5,9 +5,7 @@ import ViteComponents from 'vite-plugin-components'
5
5
const config : UserConfig = {
6
6
plugins : [
7
7
createVuePlugin ( ) ,
8
- ViteComponents ( {
9
- transformer : 'vue2' ,
10
- } ) ,
8
+ ViteComponents ( ) ,
11
9
] ,
12
10
}
13
11
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ function VitePluginComponents(options: Options = {}): Plugin {
13
13
name : 'vite-plugin-components' ,
14
14
enforce : 'post' ,
15
15
configResolved ( config ) {
16
+ if ( config . plugins . find ( i => i . name === 'vite-plugin-vue2' ) )
17
+ options . transformer = options . transformer || 'vue2'
18
+
16
19
ctx = new Context ( options , config )
17
20
transformers = [
18
21
ctx . options . transformer === 'vue2'
You can’t perform that action at this time.
0 commit comments