serverless / serverless-plugin-typescript

Serverless plugin for zero-config Typescript support
MIT License
783 stars 223 forks source link

feat: resolve tsconfig paths #241

Open perrin4869 opened 3 years ago

perrin4869 commented 3 years ago

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

MichaelKilbane commented 3 years ago

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

perrin4869 commented 3 years ago

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 commented 3 years ago

@perrin4869 when this change is going to be published?

perrin4869 commented 3 years ago

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

Ulydev commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

AlanTaranti commented 1 year ago

Hi @medikoo, can you accept this PR?

medikoo commented 1 year ago

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

perrin4869 commented 1 year ago

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

hadyrashwan commented 1 year ago

Any news on thise one ?

skix123 commented 5 months ago

Would be great to have it merged!