From a61bba7e27a0d0081d176aac6900c09f7d695428 Mon Sep 17 00:00:00 2001 From: The Arcane Brony Date: Thu, 11 Nov 2021 22:17:21 +0100 Subject: Inline plugin support --- api/src/middlewares/TestClient.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'api/src/middlewares/TestClient.ts') diff --git a/api/src/middlewares/TestClient.ts b/api/src/middlewares/TestClient.ts index 7d981f0c..b50f4e5c 100644 --- a/api/src/middlewares/TestClient.ts +++ b/api/src/middlewares/TestClient.ts @@ -23,10 +23,15 @@ export default function TestClient(app: Application) { if (GATEWAY_ENDPOINT) { html = html.replace(/GATEWAY_ENDPOINT: .+/, `GATEWAY_ENDPOINT: \`${GATEWAY_ENDPOINT}\`,`); } - - //plugins - var files = fs.readdirSync(path.join(__dirname, "..", "..", "assets", "plugins")); + // inline plugins + var files = fs.readdirSync(path.join(__dirname, "..", "..", "assets", "preload-plugins")); var plugins = ""; + files.forEach(x =>{if(x.endsWith(".js")) plugins += `\n`; }); + html = html.replaceAll("", plugins); + + // plugins + files = fs.readdirSync(path.join(__dirname, "..", "..", "assets", "plugins")); + plugins = ""; files.forEach(x =>{if(x.endsWith(".js")) plugins += `\n`; }); html = html.replaceAll("", plugins); //preload plugins -- cgit 1.5.1