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

Importing files from outside the tsconfig.json directory changes the output folder structure #16683

Closed
Arlen22 opened this issue Jun 21, 2017 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@Arlen22
Copy link

Arlen22 commented Jun 21, 2017

Something I have been trying to do several times lately is share type definitions and code between related projects, such as a client and server project where I have defined the types for the JSON that gets transferred between them and would like to use the same files instead of copying changes back and forth between the two projects. I normally output the js files right next to the ts files, as I have no need to do otherwise on the server. The client gets bundled using the Angular CLI, so it is unrelated.

TypeScript Version: 2.3.4

Code

import * as test from './cousin';

And in tsconfig.json

        "outDir": ".",
        "rootDirs": [
            "../uncle",
            "."
        ],

Expected behavior:
I expect to see an output folder structure like this:

  • me.ts
  • me.js
  • Maybe cousin.js, or nothing. I could expect cousin.js to be built separately.

Actual behavior:

  • me.ts
  • parent/
    • me.js
  • uncle/
    • cousin.js
@Saulzi
Copy link
Contributor

Saulzi commented Jun 22, 2017

I had the same some time ago.. By design.. See

#9786

@mhegazy
Copy link
Contributor

mhegazy commented Aug 23, 2017

@mhegazy mhegazy added the Duplicate An existing issue was already created label Aug 23, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Sep 6, 2017

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants