Dependency builds for plugos

This commit is contained in:
Zef Hemel
2022-05-13 14:36:26 +02:00
parent 8c974161c3
commit 3c5048ac25
29 changed files with 309 additions and 76 deletions
+1 -5
View File
@@ -41,15 +41,11 @@ while (!fs.existsSync(nodeModulesDir + "/node_modules/vm2")) {
nodeModulesDir = path.dirname(nodeModulesDir);
}
export function createSandbox(
plug: Plug<any>,
preloadedModules: string[] = []
) {
export function createSandbox(plug: Plug<any>) {
let worker = new Worker(workerCode, {
eval: true,
workerData: {
nodeModulesPath: path.join(nodeModulesDir, "node_modules"),
preloadedModules,
},
});
return new Sandbox(plug, new NodeWorkerWrapper(worker));