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

feat: resolve tsconfig paths #241

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

perrin4869
Copy link

Closes #180
This feature is behind a custom option which is turned off by default, so this PR is backwards compatible.

@perrin4869 perrin4869 changed the title Feature/tsconfig paths feat: resolve tsconfig paths Jul 8, 2021
@MichaelKilbane
Copy link

Nice work! Just a shame that there's no activity.

@perrin4869
Copy link
Author

Oh just noticed this was moved to the serverless org, there is hope after all!
I'm maintaining my own fork with the 3 PRs I have, but holding out hope that one day I can move back to upstream haha

@m-alva
Copy link

m-alva commented Aug 15, 2021

@perrin4869 when this change is going to be published?

@perrin4869
Copy link
Author

I'm not a maintainer, so no idea... I have 3 pending PRs in this repo for over a year, I'm waiting too...

Copy link
Contributor

@Scotsoo Scotsoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code consistency

src/typescript.ts Outdated Show resolved Hide resolved
@Ulydev
Copy link

Ulydev commented Oct 1, 2021

Hi @perrin4869 ! I'm trying to use your fork in my Serverless project, how do I install it so that it understands which plugin to take? Appreciate any help :)

@wweaver
Copy link

wweaver commented Dec 13, 2021

This finally solves the issue I've been having, and I'm sure many others that have been trying to avoid using webpack.

One question is if I reference this branchunivapaycast/serverless-plugin-typescript#feature/tsconfig-paths in my package.json is there a way for it to autobuild? I'm getting tsc errors when I try to trigger it.

I'm adding it by doing this

yarn workspace foo add univapaycast/serverless-plugin-typescript#feature/tsconfig-paths

Note, I already have the serverless-* set up to nohoist so that's not an issue for the workspaces I'm using.

@wweaver
Copy link

wweaver commented Dec 14, 2021

This finally solves the issue I've been having, and I'm sure many others that have been trying to avoid using webpack.

One question is if I reference this branchunivapaycast/serverless-plugin-typescript#feature/tsconfig-paths in my package.json is there a way for it to autobuild? I'm getting tsc errors when I try to trigger it.

I'm adding it by doing this

yarn workspace foo add univapaycast/serverless-plugin-typescript#feature/tsconfig-paths

Note, I already have the serverless-* set up to nohoist so that's not an issue for the workspaces I'm using.

I got this working by building my own fork of this PR. This fixes the issue in question but since the code is based upon an old version of serverless-plugin-typescript it actually introduces a different issue that was working in the later version. Any chance this code could be easily upgraded to use the latest version of the servererless-plugin-typescript package? Maybe we can push them to merge it if it's updated? 🤞🏻

@wweaver
Copy link

wweaver commented Jan 14, 2022

This finally solves the issue I've been having, and I'm sure many others that have been trying to avoid using webpack.
One question is if I reference this branchunivapaycast/serverless-plugin-typescript#feature/tsconfig-paths in my package.json is there a way for it to autobuild? I'm getting tsc errors when I try to trigger it.
I'm adding it by doing this

yarn workspace foo add univapaycast/serverless-plugin-typescript#feature/tsconfig-paths

Note, I already have the serverless-* set up to nohoist so that's not an issue for the workspaces I'm using.

I got this working by building my own fork of this PR. This fixes the issue in question but since the code is based upon an old version of serverless-plugin-typescript it actually introduces a different issue that was working in the later version. Any chance this code could be easily upgraded to use the latest version of the servererless-plugin-typescript package? Maybe we can push them to merge it if it's updated? 🤞🏻

To follow up again. I actually had to revert and couldn't use the fork because it's based upon an old version of serverless-plugin-typescript and there were features that broke that I was utilizing. So still at a loss of how to add aliases without introducing webpack. Trying very hard to avoid webpack as it turns a package from 3MB to ~250MB.

@perrin4869
Copy link
Author

Hey, sorry I didn't look at this any longer. I am not using this module anymore, instead i use ts-node for running tests and rollup to pack the modules. I also use the relatively new package.json imports field to achieve the paths this PR was meant to implement.
Please feel free to pick up this PR if you are still interested!

@wweaver
Copy link

wweaver commented Jan 20, 2022

I ended up getting the plugin serverless-tscpaths to do what I needed in conjunction with serverless-plugin-typescript and serverless-plugin-optimize.

@AlanTaranti
Copy link

Hi @medikoo, can you accept this PR?

@medikoo
Copy link
Contributor

medikoo commented Jan 26, 2023

@AlanTaranti, this PR has conflicts that need to be resolved, once that's taken care of I can possibly take a look

@perrin4869
Copy link
Author

I fixed the conflicts real fast, but didn't test properly! May need some tuning

@hadyrashwan
Copy link

Any news on thise one ?

@skix123
Copy link

skix123 commented Mar 22, 2024

Would be great to have it merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User defined path shortcuts defined in tsconfig.json are not resolved in transpiled code
10 participants