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

TSconfig support #8

Closed
Igmat opened this issue Oct 6, 2016 · 3 comments
Closed

TSconfig support #8

Igmat opened this issue Oct 6, 2016 · 3 comments

Comments

@Igmat
Copy link
Contributor

Igmat commented Oct 6, 2016

Is it planned? Or there are some restrictions for using more common way for ts developers instead of tweaking package.json?

@kulshekhar
Copy link
Owner

Could you share what you'd like and how that would be different from the current setup? I'd definitely like to improve this.

@beckend
Copy link
Contributor

beckend commented Oct 6, 2016

How about:
Instead of having

"globals": {
      "__TS_CONFIG__": {
        "module": "commonjs",
        "jsx": "react"
      }
    }

You have:

"globals": {
      "__TS_JEST__": {
        "tsconfig": "./my-tsconfig.json"
      }
    }

in preprocessor.js - getTSConfig you can use path module to resolve the file:

const path = require('path');
const config = require(path.resolve(globals.__TS_JEST__.tsconfig));
return tsc.convertCompilerOptionsFromJson(config.compilerOptions).options;

It should actually be optional, and you should automatically get the default tsconfig.json from root.

@kulshekhar
Copy link
Owner

I'll take a look at this on the weekend or if you want to take a stab at it, I'd welcome a PR :)

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