From 799a31dcc005049a8ae9bf55913ba4391018276c Mon Sep 17 00:00:00 2001 From: NovemLinguae <79697282+NovemLinguae@users.noreply.github.com> Date: Mon, 26 Dec 2022 01:04:25 -0800 Subject: [PATCH] dev-server.js: don't lazy load dependencies (#1630) * mw.loader.using * fix mw.loader.using usage Co-authored-by: Siddharth VP --- scripts/dev-server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/dev-server.js b/scripts/dev-server.js index 713771302..a8be25a31 100644 --- a/scripts/dev-server.js +++ b/scripts/dev-server.js @@ -17,7 +17,7 @@ const server = http.createServer(async (request, response) => { const jsFiles = ['morebits.js', 'twinkle.js'].concat(moduleFiles.map(f => 'modules/' + f)); const cssFiles = ['morebits.css', 'twinkle.css']; - let jsCode = `mw.loader.load(['jquery.ui', 'ext.gadget.select2']);`; + let jsCode = `mw.loader.using(['jquery.ui', 'ext.gadget.select2']).then(function () {\n`; if (process.argv[2] !== '--no-sysop') { // Pretend to be a sysop, if not one already - enables testing of sysop modules by non-sysops @@ -33,6 +33,7 @@ const server = http.createServer(async (request, response) => { jsCode += `;mw.loader.addStyleTag(${css});`; } jsCode += `;console.log('Loaded debug version of Twinkle.');`; + jsCode += `});`; // End mw.loader.using response.writeHead(200, { 'Content-Type': 'text/javascript; charset=utf-8' }); response.end(jsCode, 'utf-8'); });