Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Support tsconfig extends #328

Merged
merged 2 commits into from
Mar 26, 2021

Conversation

dummdidumm
Copy link
Member

Fixes #300

I was unsure about the boolean/string behavior of the options, especially because it is mentioned nowhere in the docs that boolean is a valid option.

Also, if I understand this correctly, by default the tsconfig.json is not picked up if I do sveltePreprocess()?

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • Run the tests with npm test or yarn test

@kaisermann
Copy link
Member

Thanks for this! Will give it a look later

Also, if I understand this correctly, by default the tsconfig.json is not picked up if I do sveltePreprocess()?

It is! If tsconfigFile is not false (the boolean that is not documented 😳 ), we start looking for the tsconfig.json in the dirname(filename).

https://github.com/sveltejs/svelte-preprocess/blob/main/src/transformers/typescript.ts#L69

tsOptions.tsconfigFile ||
ts.findConfigFile(fileDirectory, ts.sys.fileExists);

tsconfigFile = isAbsolute(tsconfigFile)
Copy link
Member Author

Choose a reason for hiding this comment

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

converting to absolute path here because else parseJsonConfigFileContent doesn't seem to work

@kaisermann kaisermann merged commit d0b4766 into sveltejs:main Mar 26, 2021
@kaisermann
Copy link
Member

kaisermann commented Mar 26, 2021

🎉 neat 🎉 . Released in 4.7.0

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.

Support "extends" tsconfig directive
2 participants