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

Using TS Paths as aliases #336

Closed
jlkiri opened this issue Nov 15, 2019 · 8 comments
Closed

Using TS Paths as aliases #336

jlkiri opened this issue Nov 15, 2019 · 8 comments
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

@jlkiri
Copy link

jlkiri commented Nov 15, 2019

Current Behavior

I have an src folder which has index.ts in it and two subfolders plugins and utils, each with more TS files. index.ts imports most of these files from subfolders, but they are neither bundled nor independently compiled. Only their types are correctly output, however.

Expected behavior

  1. Output a compiled JS file for each TS file imported by index.ts so it can be imported by the compiled index.js
    OR
  2. Bundle each originally imported file inside the index.js output file

Suggested solution(s)

Currently no idea.

Additional context

Your environment

Software Version(s)
TSDX 0.11.0
TypeScript 3.7.2
Browser
npm/Yarn 6.11.3 / 1.19.1
Node 10.16.3
Operating System MacOS
@jlkiri
Copy link
Author

jlkiri commented Nov 15, 2019

I figured out that this is only the case if imports within source files are made relative to paths option of tsconfig.json, such as src/*. If imports are relative to the importing file itself everything is alright.

@swyxio
Copy link
Collaborator

swyxio commented Dec 4, 2019

this is something we need to figure out. i suspect its a rollup fix we need to do. if you get time, please be my guest to investigate

@ambroseus
Copy link
Contributor

@ambroseus
Copy link
Contributor

ambroseus commented Dec 15, 2019

forked, fixed, checked build (using @ambroseus/tsdx) : https://github.com/DCKit/dckit/blob/master/packages/%40dckit/ui/tsconfig.json

PR: #374

@ambroseus
Copy link
Contributor

@jlkiri while PR is under review, you can test fixed version yarn add @ambroseus/tsdx

@ambroseus ambroseus mentioned this issue Dec 21, 2019
@ambroseus
Copy link
Contributor

@jlkiri solution: #379 (comment)

@jlkiri
Copy link
Author

jlkiri commented Dec 22, 2019

@ambroseus Thanks, seems to be working now. I'm closing the issue.

@jlkiri jlkiri closed this as completed Dec 22, 2019
@agilgur5 agilgur5 changed the title Imports of the entry module are not bundled Using TS Paths as aliases Mar 9, 2020
@agilgur5 agilgur5 added solution: duplicate This issue or pull request already exists and removed kind: bug Something isn't working good first issue Good for newcomers labels Mar 9, 2020
@agilgur5
Copy link
Collaborator

agilgur5 commented Mar 9, 2020

Duplicate of #91

@agilgur5 agilgur5 added the topic: TS Paths Aliases Related to using aliases with TypeScript paths label Mar 10, 2020
@agilgur5 agilgur5 marked this as a duplicate of #91 May 3, 2020
@agilgur5 agilgur5 added the solution: workaround available There is a workaround available for this issue label Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

4 participants