Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async minifyModule(
path: string,
code: string,
map: CompactRawMappings,
): Promise<{code: string, map: CompactRawMappings}> {
const sourceMap = fromRawMappings([{code, source: code, map, path}]).toMap(
undefined,
{},
);
const minified = await this._minifyCode(path, code, sourceMap);
const result = await this._postMinifyProcess({...minified});
return {
code: result.code,
map: result.map ? toRawMappings(result.map).map(compactMapping) : [],
};
}