Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (output.length > 1) {
diagnostics.push(
generateCompilerDiagnostic(ModuleResolutionErrors.RELATIVE_DYNAMIC_IMPORT)
);
}
const result = output[0];
code = result.code;
map = result.map;
} catch (e) {
// Rollup may have clobbered error.code with its own data
if (e instanceof CompilerError && (e as any).pluginCode) {
e.code = (e as any).pluginCode;
}
const diagnostic = normalizeToDiagnostic(ModuleResolutionErrors.MODULE_RESOLUTION_ERROR, e);
diagnostic.level = DiagnosticLevel.Fatal;
diagnostics.push(diagnostic);
}
return {
diagnostics,
code,
map,
};
}
if (warning.loc) {
const { loc, pos } = warning;
origin = {
filename: loc.file,
location: {
line: loc.line,
column: loc.column,
start: pos,
length: 0,
},
};
}
}
diagnostics.push(
generateCompilerDiagnostic(ModuleResolutionErrors.MODULE_RESOLUTION_ERROR, {
messageArgs: [message],
origin,
})
);
};
}