typescript gets included in node_modules
- In
yarn.lock, no package has typescript as a dependency - In
package.jsonit's underdevDependencies - In
serverless.ymlI haveexcludeDevDependencies: true
Yet for some reason when I run sls package, it's included under node_modules/typescript (and it's 60MB large!)
Tried with versions:
- 1.1.9
- 1.2.0
- 2.0.0
@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) ?
@medikoo Yes exactly.
@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)
@medikoo I can confirm that typescript is still included in the package, with excludeDevDependencies: true, using serverless ^3.15. No extra plugin.
Is there any solution to this?
IIRC I fixed it by adding this to serverless.yaml:
package:
patterns:
- '!node_modules/typescript/**'
Does that work? @gualopezb
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?