sourcemapPathTransform()
- Type:
optionalsourcemapPathTransform: (relativeSourcePath,sourcemapPath) =>string
Defined in: options/output-options.ts:218
A transformation to apply to each path in a sourcemap.
Parameters
relativeSourcePath
string
The relative path from the generated .map file to the corresponding source file.
sourcemapPath
string
The fully resolved path of the generated sourcemap file.
Returns
string
Example
js
export default defineConfig({
output: {
sourcemap: true,
sourcemapPathTransform: (source, sourcemapPath) => {
// Remove 'src/' prefix from all source paths
return source.replace(/^src//, '');
},
},
});