[add] join the pipelines
This commit is contained in:
@@ -40,21 +40,21 @@ export async function sliceAndWriteCalls(calls, FILE_PATH) {
|
|||||||
});
|
});
|
||||||
}, relatedModuleNamePath);
|
}, relatedModuleNamePath);
|
||||||
|
|
||||||
console.log(`Sliced code ${moduleName}\n`,slicedCode);
|
// console.log(`Sliced code ${moduleName}\n`,slicedCode);
|
||||||
continue;
|
// continue;
|
||||||
const writePath = path.resolve('./dist', moduleName);
|
const writePath = path.resolve('./dist', moduleName,'index.cjs');
|
||||||
if (writePath === moduleName) {
|
if (writePath === moduleName) {
|
||||||
throw Error("Unexpected Directory rewrite. Not allowed.");
|
throw Error("Unexpected Directory rewrite. Not allowed.");
|
||||||
}
|
}
|
||||||
mkdirSync(path.dirname(writePath), { recursive: true });
|
mkdirSync(path.dirname(writePath), { recursive: true });
|
||||||
console.log(`Writing to`, writePath);
|
console.log(`Writing module '${moduleName}' to '${writePath}'`);
|
||||||
|
|
||||||
writePromises.push(writeFile(writePath, slicedCode));
|
writePromises.push(writeFile(writePath, slicedCode));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Promise.all(writePromises).then(p => {
|
Promise.all(writePromises).then(p => {
|
||||||
console.log("write finished");
|
// console.log("write finished");
|
||||||
}).catch(console.log);
|
}).catch(console.log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ function main() {
|
|||||||
if (process.argv[1] === import.meta.filename) {
|
if (process.argv[1] === import.meta.filename) {
|
||||||
console.log("[SafeImport] started");
|
console.log("[SafeImport] started");
|
||||||
main();
|
main();
|
||||||
console.log("done");
|
// console.log("done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user