MCPcopy
hub / github.com/vitejs/vite / normalizeCodeFrame

Function normalizeCodeFrame

packages/vite/src/node/build.ts:978–981  ·  view source on GitHub ↗

* Esbuild code frames have newlines at the start and end of the frame, rollup doesn't * This function normalizes the frame to match the esbuild format which has more pleasing padding

(frame: string)

Source from the content-addressed store, hash-verified

976 * This function normalizes the frame to match the esbuild format which has more pleasing padding
977 */
978function normalizeCodeFrame(frame: string) {
979 const trimmedPadding = frame.replace(/^\n|\n$/g, '')
980 return `\n${trimmedPadding}\n`
981}
982
983type JsExt = 'js' | 'cjs' | 'mjs'
984

Callers 1

enhanceRollupErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected