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

Absolute imports get treated as externals #516

Closed
PolyphonyRequiem opened this issue Feb 23, 2020 · 2 comments · Fixed by #707
Closed

Absolute imports get treated as externals #516

PolyphonyRequiem opened this issue Feb 23, 2020 · 2 comments · Fixed by #707
Labels
solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue topic: TS Paths Aliases Related to using aliases with TypeScript paths

Comments

@PolyphonyRequiem
Copy link

I've got a relatively fresh project. Under src I have:

│   index.ts
│   TabletopSimulatorService.ts
│
└───domain
        TabletopSimulatorServiceMessages.ts

when I run npx tsdx build I get the following output:

│   index.d.ts
│   index.js
│   TabletopSimulatorService.d.ts
│   ttstk-channels.cjs.development.js
│   ttstk-channels.cjs.development.js.map
│   ttstk-channels.cjs.production.min.js
│   ttstk-channels.cjs.production.min.js.map
│   ttstk-channels.esm.js
│   ttstk-channels.esm.js.map
│
├───domain
        TabletopSimulatorServiceMessages.d.ts```

I would expect to see a .js and .js.map for both TabletopSimulatorService and domain/TabletopSimulatorServiceMessages

I'm assuming I need to change something in my configuration, but cannot find sufficient documentation.

@PolyphonyRequiem
Copy link
Author

Figured it out promptly after this, literally a day after first encountering it.

Change from

import * as tts from 'TabletopSimulatorService';

to
import * as tts from './TabletopSimulatorService';

@agilgur5 agilgur5 added solution: duplicate This issue or pull request already exists kind: support Asking for support with something or a specific use case topic: TS Paths Aliases Related to using aliases with TypeScript paths labels Mar 19, 2020
@agilgur5 agilgur5 changed the title [Help] tsdx watch seems to only fully transpile index.ts, converts my other .ts files to .d.ts with no js, doesn't bundle with index Absolute imports get treated as externals Mar 19, 2020
@agilgur5
Copy link
Collaborator

Duplicate of #528 / #91 etc

@agilgur5 agilgur5 added this to the v0.13.x milestone May 3, 2020
@agilgur5 agilgur5 linked a pull request May 3, 2020 that will close this issue
@agilgur5 agilgur5 added solution: workaround available There is a workaround available for this issue and removed kind: support Asking for support with something or a specific use case labels Aug 25, 2020
Repository owner locked as resolved and limited conversation to collaborators Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue topic: TS Paths Aliases Related to using aliases with TypeScript paths
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants