@@ -115,17 +115,15 @@ export function* generateScript(options: ScriptCodegenOptions): Generator<Code,
115
115
}
116
116
else {
117
117
yield generateSfcBlockSection ( options . sfc . script , 0 , options . sfc . script . content . length , codeFeatures . all ) ;
118
+ yield * generateScriptSectionPartiallyEnding ( options . sfc . script . name , options . sfc . script . content . length , '#3632/script.vue' ) ;
118
119
}
119
120
}
120
121
else if ( options . sfc . scriptSetup && options . scriptSetupRanges ) {
121
122
yield * generateScriptSetup ( options , ctx , options . sfc . scriptSetup , options . scriptSetupRanges ) ;
122
123
}
123
124
124
- if ( options . sfc . script ) {
125
- yield * generateScriptSectionPartiallyEnding ( options . sfc . script . name , options . sfc . script . content . length , '#3632/script.vue' ) ;
126
- }
127
125
if ( options . sfc . scriptSetup ) {
128
- yield * generateScriptSectionPartiallyEnding ( options . sfc . scriptSetup . name , options . sfc . scriptSetup . content . length , '#4569/main.vue' ) ;
126
+ yield * generateScriptSectionPartiallyEnding ( options . sfc . scriptSetup . name , options . sfc . scriptSetup . content . length , '#4569/main.vue' , ';' ) ;
129
127
}
130
128
131
129
if ( ! ctx . generatedTemplate ) {
@@ -148,8 +146,13 @@ export function* generateScript(options: ScriptCodegenOptions): Generator<Code,
148
146
return ctx ;
149
147
}
150
148
151
- export function * generateScriptSectionPartiallyEnding ( source : string , end : number , mark : string ) : Generator < Code > {
152
- yield `;` ;
149
+ export function * generateScriptSectionPartiallyEnding (
150
+ source : string ,
151
+ end : number ,
152
+ mark : string ,
153
+ delimiter = 'debugger'
154
+ ) : Generator < Code > {
155
+ yield delimiter ;
153
156
yield [ '' , source , end , codeFeatures . verification ] ;
154
157
yield `/* PartiallyEnd: ${ mark } */${ newLine } ` ;
155
158
}
0 commit comments