mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
write handler
This commit is contained in:
@@ -135,11 +135,10 @@ export async function build(options: Record<string, any>) {
|
||||
'const __commands = new Map();\n ' +
|
||||
commandNames.map((_, i) => `__commands.set(m${i}.meta.id, m${i});`).join("\n");
|
||||
const startFile =
|
||||
'import { interactionHandler } from "@sern/handler/internal" \n'+
|
||||
'import { interactionHandler, __dependencies } from "@sern/handler/internal" \n'+
|
||||
commandsImports.join('\n') + '\n' +
|
||||
commandMapTemplate +
|
||||
"interactionHandler([], __commands)\n"
|
||||
console.log(startFile)
|
||||
commandMapTemplate + "\n" +
|
||||
"const [emitter, err, log, client] = __dependencies();\n"
|
||||
|
||||
console.log(entryPoints)
|
||||
console.log(commandsImports)
|
||||
@@ -164,4 +163,7 @@ export async function build(options: Record<string, any>) {
|
||||
define,
|
||||
dropLabels: [buildConfig.mode === 'production' ? '__DEV__' : '__PROD__', ...buildConfig.dropLabels!],
|
||||
});
|
||||
|
||||
console.log(startFile)
|
||||
await writeFile("./dist/handler.js", startFile );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user