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

Support for Typescript? #105

Open
nabsofken opened this issue Nov 1, 2020 · 3 comments
Open

Support for Typescript? #105

nabsofken opened this issue Nov 1, 2020 · 3 comments

Comments

@nabsofken
Copy link

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']
@nilsm
Copy link

nilsm commented Nov 22, 2020

@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")

@nabsofken
Copy link
Author

@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

@softmarshmallow
Copy link

softmarshmallow commented Dec 10, 2020

Me too. The same blog brought me here, but i cannot find a way to make it work with typescript + yarn worksapce.

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

No branches or pull requests

3 participants