serverless-plugin-optimize
serverless-plugin-optimize copied to clipboard
Support for Typescript?
I have a monorepo setup that uses typescript. How do I transpile the code using this plugin. For monorepos, the serverless-plugin-typescript plugin doesn't work for a monorepo setup. I am using the presets option provided but it doesn't seem to do anything. Any suggestions?
This is a snippet of my serverless.yml file
plugins:
- serverless-plugin-optimize
- serverless-offline
- serverless-plugin-conditional-functions
custom:
serverless-offline:
noPrependStageInUrl: true
useChildProcesses: true
httpPort: 4004
optimize:
debug: true
external: ['fastify']
extensions: ['.ts', ".js"]
presets: ['env', 'preset-typescript']
@nabsofken I haven't tried it but according to https://insify.medium.com/serverless-with-typescript-in-a-monorepo-4-ways-to-make-it-work-4ea0b8f43608 it would work in conjunction with serverless-plugin-typescript
(see "Attempt 4")
@nilsm the serverless-plugin-typescript plugin doesn't work well when you have external dependencies i.e. A shared folder. The files or node modules from the shared folder do not get packaged within the services through this plugin. I am using the serverless webpack plugin with ts-loader and that seems to work, however, the package size is larger. Not sure if this plugin can support ta-loader
Me too. The same blog brought me here, but i cannot find a way to make it work with typescript + yarn worksapce.