mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Use typescript paths in cli scripts too
This commit is contained in:
parent
576ddf645f
commit
2aaa1a3fdc
23 changed files with 82 additions and 9 deletions
16
server/helpers/register-ts-paths.ts
Normal file
16
server/helpers/register-ts-paths.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { resolve } from 'path'
|
||||
const tsConfigPaths = require('tsconfig-paths')
|
||||
|
||||
const tsConfig = require('../../tsconfig.json')
|
||||
|
||||
function registerTSPaths () {
|
||||
// Thanks: https://github.com/dividab/tsconfig-paths/issues/75#issuecomment-458936883
|
||||
tsConfigPaths.register({
|
||||
baseUrl: resolve(tsConfig.compilerOptions.baseUrl || '', tsConfig.compilerOptions.outDir || ''),
|
||||
paths: tsConfig.compilerOptions.paths
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
registerTSPaths
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue