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

target is not used in an inherited TypeScript config. #49

Open
ajcrites opened this issue Feb 27, 2018 · 3 comments
Open

target is not used in an inherited TypeScript config. #49

ajcrites opened this issue Feb 27, 2018 · 3 comments

Comments

@ajcrites
Copy link

I'm not sure if this is specific to target or other options, but it's easiest to reproduce this way. I'm also not 100% sure that it's this transformer that's not using the target from an extended config, so I apologize if this wastes anyone's time, but I think I've narrowed it down.

For example, you may have a base config that looks like

{
  "compilerOptions": { "target": "es5" }
}

Then your tsconfig.json as { "extends": "./tsconfig.base.json" }.

If you use import { default as X } from 'lib'; ... <X /> then this gets transpiled to <lib_1['default'] /> which is an error.

If you update tsconfig.json to use target directly then it works as expected (<lib_1.default />).

@ds300
Copy link
Owner

ds300 commented Feb 27, 2018

Ah, yes, we can see that the tsconfig loading strategy is embarrassingly naïve.

I'll switch to TypeStrong/tsconfig asap.

Thanks for the report!

@ds300
Copy link
Owner

ds300 commented Feb 28, 2018

Hmm, didn't realise that TypeStrong/tsconfig also doesn't support the "extends" option. TypeStrong/tsconfig#21

Will have to do some more digging. Maybe I can use whatever TS itself uses to load config files.

@seanadkinson
Copy link

+1 for extends. Thanks for the lib! I'll add a PR if I can get around to it.

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

No branches or pull requests

3 participants