diff --git a/packages/plugin-vue/src/main.ts b/packages/plugin-vue/src/main.ts index 81e30619e186d0..7fb26fd39c6c03 100644 --- a/packages/plugin-vue/src/main.ts +++ b/packages/plugin-vue/src/main.ts @@ -159,7 +159,7 @@ export async function transformMain( const generator = SourceMapGenerator.fromSourceMap( new SourceMapConsumer(map) ) - const offset = (scriptCode.match(/\r?\n/g)?.length ?? 1) + 1 + const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1 const templateMapConsumer = new SourceMapConsumer(templateMap) templateMapConsumer.eachMapping((m) => { generator.addMapping({