diff --git a/packages/uni-cli-shared/src/vite/plugins/vitejs/utils.ts b/packages/uni-cli-shared/src/vite/plugins/vitejs/utils.ts index de853082152875b4b77b7ca49d677c41b8fc268b..d139346b6076a35ddaa2c61c3bdd3b561252cb9d 100644 --- a/packages/uni-cli-shared/src/vite/plugins/vitejs/utils.ts +++ b/packages/uni-cli-shared/src/vite/plugins/vitejs/utils.ts @@ -133,10 +133,10 @@ export function locToStartAndEnd( export function generateCodeFrame( source: string, start: number | { line: number; column: number } = 0, - end = source.length + end?: number ): string { start = posToNumber(source, start) - + end = end || start // Split the content into individual lines but capture the newline sequence // that separated each line. This is important because the actual sequence is // needed to properly take into account the full line length for offset