Conversation
|
@dudiq is this PR still alive? |
|
@zachbryant i guess this question is more to you. i can't merge it to master and resolve problem with extend field |
|
@dudiq are you able to see the comments I left in review? |
|
@zachbryant nope |
|
@zachbryant still no any comments |
| ); | ||
| if (!result?.config) { | ||
| throw new Error(`Missing or invalid tsconfig.json in project root (${options.projectRoot})`); | ||
| throw new Error(`Missing or invalid ${names.join(',')} in project root (${options.projectRoot})`); |
| } | ||
|
|
||
| async function loadCompilerOptions(options, resolveFrom) { | ||
| let baseConfig = await loadConfigByName(['tsconfig.json', 'tsconfig.js'], options, resolveFrom) |
There was a problem hiding this comment.
The naming of this variable is ambiguous. I suggest childConfig for this line and parentConfig in place of extendsConfig
| return result.config; | ||
| } | ||
|
|
||
| async function loadCompilerOptions(options, resolveFrom) { |
There was a problem hiding this comment.
To reduce references to compilerOptions let's keep loadConfig and have loadCompilerOptions call the former and do error checks
| return baseConfig.compilerOptions | ||
| } | ||
| let extendsConfig = await loadConfigByName([baseConfig.extends], options, resolveFrom) | ||
| return extendsConfig?.compilerOptions || baseConfig?.compilerOptions ? { |
There was a problem hiding this comment.
If the project tsconfig extends another, this line drops the base config entirely. Unless items are undefined (I expect missing keys to just be missing rather than undefined, but I'll double check), it should just be:
return {
...extendsConfig.compilerOptions,
...baseConfig.compilerOptions,
};| return baseConfig.compilerOptions | ||
| } | ||
| let extendsConfig = await loadConfigByName([baseConfig.extends], options, resolveFrom) | ||
| return extendsConfig?.compilerOptions || baseConfig?.compilerOptions ? { |
There was a problem hiding this comment.
loadConfigByName checks for null results already, so qualifiers are not needed
| /** Populate a map with any paths from tsconfig.json starting from baseUrl */ | ||
| async function loadTsPaths(resolveFrom: string, options, logger): Promise<PathMapType> { | ||
| let config = await loadConfig(options, resolveFrom); | ||
| let compilerOptions = config?.['compilerOptions']; |
There was a problem hiding this comment.
I would like to keep this line just to reduce code size
Woops, I don't use github for reviews enough 😂 should be visible now |
|
Hi @dudiq & @zachbryant, any updates on this? I'm happy to open a new PR if this is no longer being worked on. |
|
Hey @jlalmes , I'd be happy to see a PR here. I can get to this shortly if you'd prefer I do it. Timelines on updates for this have slowed as I don't use parcel much these days |
In some cases
tsconfig.jsonmayextendsfrom other file. And it may havebaseUrlwithpathsfields inside