@samitouri / QOSami-HFS / commits / f5a50822

support require() in server_code

Massimo Melina committed Jan 29, 2026 at 17:25 UTC f5a508221f22746ec8f1d2863431e7e27e9b9162
1 file changed +1 -1
src/plugins.ts
+1 -1
@@ -332,7 +332,7 @@ const serverCode = defineConfig('server_code', '', async (script, { k }) => {
332 catch {}
333 const res: any = {}
334 try {
335 - new Function('exports', script)(res) // parse
335 + new Function('exports,require', script)(res, require) // parse
336 await initPlugin(res)
337 res.getCustomHtml = () => callable(res.customHtml) || {}
338 return new Plugin(SERVER_CODE_ID, '', res, _.noop)