2019-10-21 11:13:07 -04:00
|
|
|
import { resolve } from 'path'
|
2020-01-31 10:56:52 -05:00
|
|
|
import tsConfigPaths = require('tsconfig-paths')
|
2019-10-21 11:13:07 -04:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|