/** * convert tsconfig.json paths to webpack alias */ const convertTSConfigPaths2Aliases = () => { const tsConfigPath = path.resolve(process.cwd(), './tsconfig.json');
try { if (fs.existsSync(tsConfigPath)) { // dealing with json file with comments, we use json5 to parse tsconfig.json instead of requiring directly const tsConfig = JSON5.parse(fs.readFileSync(tsConfigPath)); let { baseUrl, paths } = get(tsConfig, 'compilerOptions', {});