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

Usage of tsconfig.json field rootDir #148

Closed
DanielSchuech opened this issue Jun 9, 2016 · 3 comments · Fixed by #174
Closed

Usage of tsconfig.json field rootDir #148

DanielSchuech opened this issue Jun 9, 2016 · 3 comments · Fixed by #174
Labels

Comments

@DanielSchuech
Copy link

I think that the rootDir field of the tsconfig.json is currently not used by tsify.
A problem only exists when you use an es5 or es6 entry file for browserify and have no ts file in the same directory. The ts fiels will be recognized by tsify but are not cahced with the right folder structure so that they are not found by getCompiledFile.

The workaround is creating an empty ts file in the directory of the browserify entry file.

@cartant
Copy link
Contributor

cartant commented Aug 6, 2016

Could you give me an example of your hierarchy so that I can check this out? That is, this type of thing:

project/
 ├── a.js
 └── b.ts

It's possible that this is fixed in #171. I'd like to make sure before I do the next release.

@DanielSchuech
Copy link
Author

project/
 ├── subfolder
 │      └── b.ts
 └── entry.js

The entry.ts is the entry file for browserify. I load there b.ts with require('./subfolder/b'). In this case the file b.tscannot be found. The problem is that tsify uses the folder in which the first ts file is found as root directory. Thats correct in the default way. There is an option rootDir in the tsconfig.json to change this behavior. This option has to be set to project in the example. I think that this option is currently not recognized by tsify.

I am currently working with the described workarround to create an empty ts file at the whished root. So my workarround folder sturcture looks like the following:

project/
 ├── subfolder
 │      └── b.ts
 ├── empty.ts
 └── entry.js

@cartant
Copy link
Contributor

cartant commented Aug 6, 2016

Thanks. I'll check it out.

cartant added a commit to cartant/tsify that referenced this issue Aug 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants