mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
build: switch to esbuild-plugin-version-injector for injecting version strings (#8723)
This commit is contained in:
@@ -33,10 +33,11 @@ function findPackageJSON(
|
||||
*/
|
||||
function version(name: string): string {
|
||||
try {
|
||||
const pkg =
|
||||
name === '@discordjs/voice'
|
||||
? require('../../package.json')
|
||||
: findPackageJSON(dirname(require.resolve(name)), name, 3);
|
||||
if (name === '@discordjs/voice') {
|
||||
return '[VI]{{inject}}[/VI]';
|
||||
}
|
||||
|
||||
const pkg = findPackageJSON(dirname(require.resolve(name)), name, 3);
|
||||
return pkg?.version ?? 'not found';
|
||||
} catch {
|
||||
return 'not found';
|
||||
|
||||
Reference in New Issue
Block a user