serverless-plugin-typescript icon indicating copy to clipboard operation
serverless-plugin-typescript copied to clipboard

fix: Skip functions that do not use node runtime. Allows mixed runtime projects

Open vectorjohn opened this issue 5 years ago • 2 comments

I have a project that needs to use some Java functions but the majority is using typescript. Unless I'm missing something, I didn't see a way to do that with this plugin because it attempts to tsc every function and of course fails. It entirely ignores the runtime choice. So I added getNodeFunctions which just returns this.functions and filters based on the runtime (function specific or service.provider.runtime). This is used instead of this.functions in rootFileNames() as well as moveArtifacts.

Moved TypeScriptPlugin class into its own file to not have conflicting export mechanisms. Needed by the new test. There might be a better fix, but the code as written complained in tests that TypeScriptPlugin was not a constructor when I tried importing from index.js, I think it's because the class was exported and also module.exports was replaced.

vectorjohn avatar Feb 03 '20 22:02 vectorjohn

Can we please merge this. Without this addition, it forces an entire code base to use the same runtime.

jean343 avatar Dec 13 '21 16:12 jean343

I have the same issue! Please merge this PR! 🙏

TomoyaOnishi avatar Jun 19 '22 08:06 TomoyaOnishi

It looks like a version of this was merged by https://github.com/serverless/serverless-plugin-typescript/pull/277 so I'm closing this.

vectorjohn avatar Sep 30 '22 21:09 vectorjohn