Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

fix(typescriptTransform): Let tsc read the config instead of using 'require' #75

Merged
merged 1 commit into from
Jun 8, 2017
Merged

Conversation

DorianGrey
Copy link
Collaborator

Hi there,

I'm currently migrating one of my playground projects to use CRA as a base.
While adopting everything, I've spotted a problem with the typescript transformation process.

Although the tsconfig is in JSON format, it may contain the extends option for configuration inheritance. In that case, using plain require would lead to an unexpected result.

Example:
tsconfig for dev and build
tsconfig for test

The config for dev and build uses module: "es2015" for tree-shaking, while the one for tests uses module: "commonjs", since the tests won't work with the first option. However, every other option should remain untouched, thus - configuration inheritance.
Using the readConfigFile function correctly follows the extends reference and thus allows to use different configs for dev/build and test.

(Don't mind that the referenced project does not build correctly (yet), still working on it ...)

…g it

Requiring the config does not support tsconfig options like "extends", which is useful for using multiple configs on a single project.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants