This repository was archived by the owner on Jan 18, 2022. It is now read-only.
File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
compileStyleAsync ,
13
13
compileTemplate ,
14
14
parse ,
15
+ compileScript ,
15
16
SFCBlock ,
16
17
SFCDescriptor ,
17
18
SFCTemplateCompileOptions ,
@@ -152,6 +153,9 @@ export default function PluginVue(userOptions: Partial<Options> = {}): Plugin {
152
153
compilerOptions : {
153
154
...options . compilerOptions ,
154
155
scopeId : hasScoped ? `data-v-${ query . id } ` : undefined ,
156
+ bindingMetadata : descriptor . script
157
+ ? descriptor . script . bindings
158
+ : undefined ,
155
159
} ,
156
160
transformAssetUrls : options . transformAssetUrls ,
157
161
} )
@@ -351,7 +355,6 @@ function parseSFC(
351
355
sourceMap : true ,
352
356
filename : id ,
353
357
sourceRoot : sourceRoot ,
354
- pad : 'line' ,
355
358
} )
356
359
357
360
cache . set ( id , descriptor )
@@ -447,7 +450,8 @@ function getTemplateCode(
447
450
448
451
function getScriptCode ( descriptor : SFCDescriptor , resourcePath : string ) {
449
452
let scriptImport = `const script = {}`
450
- if ( descriptor . script ) {
453
+ if ( descriptor . script || descriptor . scriptSetup ) {
454
+ descriptor . script = compileScript ( descriptor )
451
455
const src = descriptor . script . src || resourcePath
452
456
const attrsQuery = attrsToQuery ( descriptor . script . attrs , 'js' )
453
457
const srcQuery = descriptor . script . src ? `&src` : ``
You can’t perform that action at this time.
0 commit comments