Skip to content

Conversation

@nokazn
Copy link

@nokazn nokazn commented Apr 13, 2022

Overview

Hi, there!
I've made a PR to add a new CLI option and resolve potential problems. If there is something wrong or missing, feel free to point it out.
Thank you.

Changes

  • add --tsconfig-path to specify path to tsconfig.json file for CLI option
    • if path to tsconfig.json is passed by this option, ncc sees that path directly, or if not, ncc resolve path to tsconfig.json as before
  • support extends property in tsconfig.json
    • use officially provided API by TypeScript to resolve and parse compilerOptions & extends property
    • add param-case to convert values at jsx option to kebab-case
    • use tsconfck to parse tsconfig.json options.

Related

@nokazn nokazn requested review from Timer and styfle as code owners April 13, 2022 13:31
* @param {ts.ModuleResolutionKind} moduleResolution
* @returns {string | undefined}
*/
function normalizeModuleResolutionOption(moduleResolution) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem very future proof.

Is there a way to have TypeScript convert this for us?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@styfle
I see.
I cloudn't find a way to get complete config objects by TypeScript, but I found tsconfck from microsoft/TypeScript#44573.

Does this library look future proof, do you think? If you think it's OK, I will rewrite src/utils/load-tsconfig-options.js.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rewrited this & related parts by 5d85cd2, which uses tsconfck.
Would be glad to review it.

@nokazn nokazn force-pushed the feature/#457/specify-tsconfig branch 2 times, most recently from d2b6b92 to 129d3df Compare April 16, 2022 04:15
@nokazn nokazn force-pushed the feature/#457/specify-tsconfig branch from 129d3df to 5d85cd2 Compare April 16, 2022 04:23
@nokazn nokazn requested a review from styfle April 16, 2022 04:25
@TheRealBarenziah
Copy link

This is a great feature, thanks nokazn! 👏
I hope your work will be merged soon as ncc TS support is incomplete without it. Unfortunately, since ncc lacks preinstall script it's a hassle to use the fork in the meantime.

@mreis1
Copy link
Contributor

mreis1 commented Jan 20, 2023

Why is still on hold? Thanks for the PR

@YElyousfi
Copy link

Hello, when can we expect this to PR to be merged?

@steverhoades
Copy link

Very interested in this addition. Is there anything I can do to help get this across the finish line?

@vtgn
Copy link

vtgn commented Jun 15, 2023

Hello, what's new about this?
This is very embarrassing to not be able to set the tsconfig file to use. :/
For example, the NestJs framework standard is to name the tsconfig file tsconfig.build.json for the code only, extending the tsconfig.json file used for code and test.
Without this feature, we cannot respect the NestJs standard. :(
Regards.

@wwereal
Copy link

wwereal commented Jul 29, 2024

any update?

@Armadillidiid
Copy link

Is there anything left to be done to get this PR merged? I don't mind helping out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to specify path to tsconfig.json

9 participants