1
0
Fork 0
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:
Chocobozzz 2019-10-21 17:13:07 +02:00
parent 576ddf645f
commit 2aaa1a3fdc
No known key found for this signature in database
GPG key ID: 583A612D890159BE
23 changed files with 82 additions and 9 deletions

View 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
}