Skip to content

Commit 23a1615

Browse files
committed
trying compiler options CommonJS
1 parent d7638b1 commit 23a1615

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

server/app.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ import express, { Application } from 'express'
3434
import { useExpressServer, useContainer } from 'routing-controllers'
3535
import { Container } from 'typedi'
3636
import path from 'path'
37-
import { fileURLToPath } from 'url'
3837
import { execSync } from 'child_process'
3938
import { OAuth2Service } from './services/OAuth2Service'
4039

41-
// Fix __dirname for ESM/tsx compatibility
42-
const __filename = fileURLToPath(import.meta.url)
43-
const __dirname = path.dirname(__filename)
40+
// __dirname is available in CommonJS
41+
// const __dirname is automatically available
4442

4543
const port = 8085
4644
const app: Application = express()

tsconfig.server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"module": "ES2020",
3+
"module": "CommonJS",
44
"moduleResolution": "node",
55
"esModuleInterop": true,
66
"target": "ES2020",

0 commit comments

Comments
 (0)