@@ -115,17 +115,15 @@ export function* generateScript(options: ScriptCodegenOptions): Generator<Code,
115115 }
116116 else {
117117 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' ) ;
118119 }
119120 }
120121 else if ( options . sfc . scriptSetup && options . scriptSetupRanges ) {
121122 yield * generateScriptSetup ( options , ctx , options . sfc . scriptSetup , options . scriptSetupRanges ) ;
122123 }
123124
124- if ( options . sfc . script ) {
125- yield * generateScriptSectionPartiallyEnding ( options . sfc . script . name , options . sfc . script . content . length , '#3632/script.vue' ) ;
126- }
127125 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' , ';' ) ;
129127 }
130128
131129 if ( ! ctx . generatedTemplate ) {
@@ -148,8 +146,13 @@ export function* generateScript(options: ScriptCodegenOptions): Generator<Code,
148146 return ctx ;
149147}
150148
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 ;
153156 yield [ '' , source , end , codeFeatures . verification ] ;
154157 yield `/* PartiallyEnd: ${ mark } */${ newLine } ` ;
155158}
0 commit comments