Commit e7263b9 1 parent dc8e6c9 commit e7263b9 Copy full SHA for e7263b9
File tree 1 file changed +16
-9
lines changed
1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -100,9 +100,16 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
100
100
? createFilter ( / \. ( j | t ) s x ? $ / )
101
101
: createFilter ( refTransform )
102
102
103
+ // compat for older verisons
104
+ const canUseRefTransform = typeof shouldTransformRef === 'function'
105
+
103
106
let options : ResolvedOptions = {
104
107
isProduction : process . env . NODE_ENV === 'production' ,
105
108
...rawOptions ,
109
+ include,
110
+ exclude,
111
+ customElement,
112
+ refTransform,
106
113
root : process . cwd ( )
107
114
}
108
115
@@ -182,15 +189,15 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
182
189
return
183
190
}
184
191
if ( ! filter ( filename ) && ! query . vue ) {
185
- if (
186
- refTransformFilter ( filename ) &&
187
- ! query . vue &&
188
- shouldTransformRef ( code )
189
- ) {
190
- return transformRef ( code , {
191
- filename ,
192
- sourceMap : true
193
- } )
192
+ if ( ! query . vue && refTransformFilter ( filename ) ) {
193
+ if ( ! canUseRefTransform ) {
194
+ this . warn ( 'refTransform requires @vue/compiler-sfc@^3.2.5.' )
195
+ } else if ( shouldTransformRef ( code ) ) {
196
+ return transformRef ( code , {
197
+ filename ,
198
+ sourceMap : true
199
+ } )
200
+ }
194
201
}
195
202
return
196
203
}
You can’t perform that action at this time.
0 commit comments