use sourcemaps

This commit is contained in:
Erik 2023-12-08 23:13:09 +02:00
parent 8dc57444b2
commit 3d5909724f
3 changed files with 10 additions and 5 deletions

View File

@ -2,7 +2,8 @@
"rootDir": "Should be overwritten in index.ts",
"shardOptions": {
"totalShards": "auto",
"respawn": true
"respawn": true,
"execArgv": ["--enable-source-maps"]
},
"discord": {
"prefix": "!",

View File

@ -10,7 +10,7 @@
"debug": "node --trace-warnings --inspect index.js",
"update": "git pull && cd api && yarn update",
"test": "jest --detectOpenHandles",
"lint": "eslint --fix src/**",
"lint": "eslint --fix src/",
"build": "tsc --build"
},
"repository": {

View File

@ -53,7 +53,7 @@ class Controller extends EventEmitter
throw new Error(`Client path does not seem to exist: ${clientPath}`);
this.#options = options;
const { shardList, totalShards } = Controller.parseShardOptions(options.shardOptions);
const { shardList, totalShards, execArgv } = Controller.parseShardOptions(options.shardOptions);
options.discord.rootDir = options.rootDir;
options.discord.logger = options.logger;
@ -65,7 +65,7 @@ class Controller extends EventEmitter
shardList,
respawn,
shardArgs: [],
execArgv: [],
execArgv,
token: process.env.DISCORD_TOKEN,
clientOptions: options.discord,
};
@ -346,7 +346,11 @@ class Controller extends EventEmitter
if (!Number.isInteger(totalShards))
throw new Error('TotalShards must be an integer.');
}
return { shardList, totalShards };
let { execArgv } = options;
if (!execArgv)
execArgv = [];
return { shardList, totalShards, execArgv };
}
get version ()