mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
feat: support .cjs, .mjs, .ts, .mts and .cts extensions in seyfert.config file (#214)
* refactor: update import statement in sharder.ts * feat: support .mjs and .ts extensions in seyfert.config file * feat: support .cts, .mts and .cjs extensions in seyfert.config
This commit is contained in:
parent
ddc6dab0db
commit
f05ba46b3a
@ -364,7 +364,11 @@ export class BaseClient {
|
||||
>() {
|
||||
const seyfertConfig = (BaseClient._seyfertConfig ||
|
||||
(await this.options.getRC?.()) ||
|
||||
(await magicImport(join(process.cwd(), 'seyfert.config.js')).then(x => x.default ?? x))) as T;
|
||||
(await Promise.any(
|
||||
['.js', '.mjs', '.cjs', '.ts', '.mts', '.cts'].map(ext =>
|
||||
magicImport(join(process.cwd(), `seyfert.config${ext}`)).then(x => x.default ?? x),
|
||||
),
|
||||
))) as T;
|
||||
|
||||
const { locations, debug, ...env } = seyfertConfig;
|
||||
|
||||
|
@ -17,7 +17,7 @@ import {
|
||||
import { ShardManagerDefaults } from '../constants';
|
||||
import { DynamicBucket } from '../structures';
|
||||
import { ConnectQueue } from '../structures/timeout';
|
||||
import { Shard } from './shard.js';
|
||||
import { Shard } from './shard';
|
||||
import type { ShardManagerOptions, WorkerData } from './shared';
|
||||
|
||||
let parentPort: import('node:worker_threads').MessagePort;
|
||||
|
Loading…
x
Reference in New Issue
Block a user