fix: switch backend to CommonJS to fix ESM module resolution

Remove 'type: module' and use CommonJS output so Node.js resolves
imports without requiring explicit .js extensions.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Haiku 4.5 committed 2026-04-16 11:01:48 +02:00
1 parent ffb85ade90
commit 00d92fc668
3 files changed
+2 -7

No files matched your search

-1
View File
@@ -3,7 +3,6 @@
"version": "1.0.0",
"description": "Podcastic - Multi-user podcast streaming application backend",
"main": "dist/index.js",
"type": "module",
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
-4
View File
@@ -2,7 +2,6 @@ import express from 'express';
import cors from 'cors';
import 'dotenv/config';
import path from 'path';
import { fileURLToPath } from 'url';
import { connectDB } from './config/database';
import { initRedis, closeRedis } from './config/redis';
import { errorHandler } from './middleware/errorHandler';
@@ -10,9 +9,6 @@ import authRoutes from './routes/authRoutes';
import podcastRoutes from './routes/podcastRoutes';
import episodeRoutes from './routes/episodeRoutes';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const app = express();
const PORT = process.env.PORT || 5000;
+2 -2
View File
@@ -1,9 +1,9 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"module": "CommonJS",
"lib": ["ES2020"],
"moduleResolution": "bundler",
"moduleResolution": "node",
"resolveJsonModule": true,
"allowJs": true,
"strict": true,