import Session from "./Session.js";

let session = new Session();

loadPlugins()
  .then(() => session.connect());

async function loadPlugins()
{
  let pluginEntryScripts = <%- JSON.stringify(entryScripts) %>;
  let importPromises = [];

  for(let entryScript of pluginEntryScripts) {
    let importPromise = import(entryScript).then(loadPlugin);

    importPromises.push(importPromise);
  }

  await Promise.all(importPromises);
}

function loadPlugin(module)
{
  module.default(session);
}
@@ -33,460 +33,338 @@
 s%22;%0A
-%0Alet session = new Session();%0A%0AloadPlugins()%0A  .then(() =%3E session.connect());%0A%0Aasync function loadPlugins()%0A%7B%0A  let pluginEntryScripts = %3C%25- JSON.stringify(entryScripts) %25%3E;%0A  let importPromises = %5B%5D;%0A%0A  for(let entryScript of pluginEntryScripts) %7B%0A    let importPromise = import(entryScript).then(loadPlugin);%0A%0A    importPromises.push(importPromise);%0A  %7D%0A%0A  await Promise.all(importPromises);%0A%7D%0A%0Afunction loadPlugin(module)%0A%7B%0A  module.default(session);%0A%7D
+%3C%25 for(let i = 0; i %3C entryScripts.length; i++) %7B -%25%3E%0Aimport %7B default as plugin%3C%25- i %25%3E %7D from %22%3C%25- entryScripts%5Bi%5D %25%3E%22;%0A%3C%25 %7D -%25%3E%0A%0Alet session = new Session();%0A%0AloadPlugins()%0A  .then(() =%3E session.connect());%0A%0Aasync function loadPlugins()%0A%7B%0A%3C%25 for(let i = 0; i %3C entryScripts.length; i++) %7B -%25%3E%0A  plugin%3C%25- i %25%3E(session);%0A%3C%25 %7D -%25%3E%0A%7D%0A

Remove dynamic import in client source