Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function processOutput(ns, jsTempFile, jsOutputFile, options) {
const content = fs.readFileSync(jsTempFile.path);
// Check whether the output has changed since last build
const contentHash = hash(content);
if (cache[ns] && cache[ns].hash === contentHash) return null;
// Split output
const modules = findImports(content);
const sourcemaps = fs.existsSync(`${jsTempFile.path}.map`);
const sizeReport = !!options.sizeReport;
const results = split
.run(
jsTempFile.path,
jsOutputFile,
modules,
sourcemaps,
true /* commonjs - required */,
false /* debug sourcemap - unsupported*/,
sizeReport,
graphHooks
)
.filter(entry => entry && entry.source);
// Inject .hx sources in map file
results.forEach(entry => {
if (entry.map) {
const map = entry.map.content;