serverless / serverless-plugin-typescript

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

typescript gets included in node_modules #252

Open serg06 opened 2 years ago

serg06 commented 2 years ago

Yet for some reason when I run sls package, it's included under node_modules/typescript (and it's 60MB large!)

Tried with versions:

medikoo commented 2 years ago

@serg06 Are you stating that you have typescript listed in service devDependencies, yet it gets packaged for lambda (even though exclusion of dev dependencies is applied) ?

serg06 commented 2 years ago

@medikoo Yes exactly.

medikoo commented 2 years ago

@serg06 will it happen also if you run sls package but with no plugins section in serverless.yml (I know it will create not working artifact, but I want to confirm whether any plugin influences that)

tusbar commented 2 years ago

@medikoo I can confirm that typescript is still included in the package, with excludeDevDependencies: true, using serverless ^3.15. No extra plugin.

gualopezb commented 2 years ago

Is there any solution to this?

serg06 commented 2 years ago

IIRC I fixed it by adding this to serverless.yaml:

package:
  patterns:
    - '!node_modules/typescript/**'

Does that work? @gualopezb

gualopezb commented 2 years ago

Yes, it does the trick. I was just wondering if this is indeed an issue with the serverless-plugin-typescript module and, if so, is it going to be fixed in a future version?