diff --git a/docker-scripts.js b/docker-scripts.js index 958ca75..7278411 100644 --- a/docker-scripts.js +++ b/docker-scripts.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { execSync } from "child_process"; -import packageJson from "./package.json" with { type: "json" }; +const { execSync } = require("child_process"); +const packageJson = require("./package.json"); const version = packageJson.version; const command = process.argv[2]; diff --git a/package.json b/package.json index 121be10..0f1467e 100644 --- a/package.json +++ b/package.json @@ -4,14 +4,13 @@ "version": "2.2.8", "description": "A Discord bot that plays music", "main": "index.js", - "type": "module", "engines": { "node": ">=20.x" }, "scripts": { "dev": "tsx watch src/index.ts", "start": "node dist/index.js", - "build": "tsup src/index.ts --format esm --minify --external unfetch,ffmpeg-static", + "build": "tsup src/index.ts --minify --external unfetch,ffmpeg-static", "docker-build": "node docker-scripts.js build", "docker-save": "node docker-scripts.js save", "build-prod": "npm run build && npm run docker-build && npm run docker-save", diff --git a/src/utils/helpers/youtubeCookieHandler/youtubeCookieHandler.ts b/src/utils/helpers/youtubeCookieHandler/youtubeCookieHandler.ts index 8e757ea..8b0e853 100644 --- a/src/utils/helpers/youtubeCookieHandler/youtubeCookieHandler.ts +++ b/src/utils/helpers/youtubeCookieHandler/youtubeCookieHandler.ts @@ -1,9 +1,6 @@ import { config } from "@/config"; import fs from "fs"; import path from "path"; -import { fileURLToPath } from "url"; - -const __dirname = path.dirname(fileURLToPath(import.meta.url)); /** * Handles YouTube cookies by reading from environment variables, diff --git a/tsconfig.json b/tsconfig.json index fe1b63c..eab39a6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "target": "ES2022", - "module": "esnext", - "moduleResolution": "bundler", + "module": "nodenext", + "moduleResolution": "nodenext", "rootDir": "./src", "outDir": "./dist", "removeComments": true,