Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function asPlainBundle({
filename,
idsForPath,
modules,
requireCalls,
sourceMapPath,
enableIDInlining,
}): {|
code: string | Buffer,
extraFiles?: Iterable<[string, string | Buffer]>,
map: MixedSourceMap,
|} {
const builder = new BundleBuilder(filename);
const modIdForPath = (x: {path: string, ...}) => idsForPath(x).moduleId;
for (const module of concat(modules, requireCalls)) {
const {moduleCode, moduleMap} = getModuleCodeAndMap(module, modIdForPath, {
enableIDInlining,
});
builder.append(moduleCode + '\n', moduleMap);
}
if (sourceMapPath) {
builder.append(`//# sourceMappingURL=${sourceMapPath}`);
}
const code = builder.getCode();
const map = builder.getMap();