Skip to content

is tsconfig include supported? #1105

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

Closed
giladgray opened this issue Oct 17, 2016 · 3 comments · Fixed by #1166
Closed

is tsconfig include supported? #1105

giladgray opened this issue Oct 17, 2016 · 3 comments · Fixed by #1166

Comments

@giladgray
Copy link

my project relies on include to bring in some typings from a shared folder:

"include": [
    "../typings/tsd.d.ts",
    "../../../test/typings/tsd.d.ts",
    "**/*"
],

this works just fine in tsc or in webpack but blows up in Atom, saying that all the typings in both tsd.d.ts files cannot be found. it would seem that atom-typescript is simply ignoring the include option so those two extra files are never included in the build. yet every other typescript environment respects this flag, and it's part of the 2.0 standard.

@giladgray
Copy link
Author

giladgray commented Oct 17, 2016

oddly enough, renaming include to filesGlob in the above example causes Atom to work again (but of course totally dies in webpack, so not sustainable).

so perhaps a fix would be relatively simple!

@pimterry
Copy link

I've had a quick look at this, as I need include too.

The filesGlob support is currently all in https://github.com/TypeStrong/tsconfig, a dependency. Unfortunately though, this project depends on v2.2.0 of tsconfig, which is now at version v5.0.3. It no longer has the API this package calls (parseFileSync), and all the filesGlob & exclude handling logic this plugin depends on has been removed, which makes this tricky.

I would really use this too and it clearly needs adding, since everybody else already supports it and afaict it's the standard way of specifying your build files now. It's a reasonable sized chunk of work to get this working with the new tsconfig and to work out how to add include to that too though, sadly.

@blakeembrey - is there a plan for how these two packages are going to be reunited? Should tsconfig include/exclude parsing be readded to this package, or readded to tsconfig, or put somewhere else?

@blakeembrey
Copy link
Member

blakeembrey commented Oct 18, 2016

I would prefer that support for filesGlob goes away and you rely directly on the TypeScript compiler to do this instead. That's the reason I killed support for it in tsconfig too (the only support remaining is searching for files and resolving, because TypeScript is buggy with this still). This is the function you should use for this: https://github.com/TypeStrong/ts-node/blob/master/src/index.ts#L445.

Edit: The main reason I didn't want to dive into support include is that TypeScript isn't using file globs, it's using a custom algorithm that can and will change (like everything else in that config file 😝). I've run into it too many times, so I trimmed the fat after include become official so people can rely on the compiler itself.

@TypeStrong TypeStrong locked and limited conversation to collaborators Jan 20, 2019
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 a pull request may close this issue.

3 participants