Browse Source

forceConsistentCasingInFileNames to true

Chocobozzz 2 years ago
parent
commit
e874edd9f8
3 changed files with 5 additions and 4 deletions
  1. 1 1
      server/controllers/tracker.ts
  2. 3 2
      server/helpers/core-utils.ts
  3. 1 1
      tsconfig.json

+ 1 - 1
server/controllers/tracker.ts

@@ -2,7 +2,7 @@ import { Server as TrackerServer } from 'bittorrent-tracker'
 import express from 'express'
 import { createServer } from 'http'
 import proxyAddr from 'proxy-addr'
-import { Server as WebSocketServer } from 'ws'
+import { WebSocketServer } from 'ws'
 import { Redis } from '@server/lib/redis'
 import { logger } from '../helpers/logger'
 import { CONFIG } from '../initializers/config'

+ 3 - 2
server/helpers/core-utils.ts

@@ -164,9 +164,10 @@ let rootPath: string
 function root () {
   if (rootPath) return rootPath
 
-  // We are in /helpers/utils.js
-  rootPath = join(__dirname, '..', '..')
+  rootPath = __dirname
 
+  if (basename(rootPath) === 'helpers') rootPath = resolve(rootPath, '..')
+  if (basename(rootPath) === 'server') rootPath = resolve(rootPath, '..')
   if (basename(rootPath) === 'dist') rootPath = resolve(rootPath, '..')
 
   return rootPath

+ 1 - 1
tsconfig.json

@@ -10,6 +10,7 @@
     "removeComments": true,
     "strictBindCallApply": true,
     "esModuleInterop": true,
+    "forceConsistentCasingInFileNames": true,
     "outDir": "./dist",
     "lib": [
       "dom",
@@ -20,7 +21,6 @@
       "es2019"
     ],
     "typeRoots": [
-      "node_modules/sitemap/node_modules/@types",
       "node_modules/@types",
       "server/typings"
     ],