Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bundle,
bundleGraph,
contents,
getInlineReplacement: (dependency, inlineType, content) => ({
from: `"${dependency.id}"`,
to: inlineType === 'string' ? JSON.stringify(content) : content,
}),
getInlineBundleContents,
map,
});
}
// If scope hoisting is enabled, we use a different code path.
if (options.scopeHoist) {
let ast = await concat(bundle, bundleGraph);
ast = link({bundle, bundleGraph, ast, options});
return replaceReferences({
contents: generate(bundleGraph, bundle, ast, options).contents,
map: null,
});
}
if (bundle.env.outputFormat === 'esmodule') {
throw new Error(
`esmodule output is not supported without scope hoisting.`,
);
}
// For development, we just concatenate all of the code together
// rather then enabling scope hoisting, which would be too slow.
let codeQueue = new PromiseQueue({maxConcurrent: 32});
let mapQueue = new PromiseQueue({maxConcurrent: 32});