Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Integration with serverless-plugin-typescript #563

Open
Honatas opened this issue Aug 3, 2021 · 0 comments
Open

Integration with serverless-plugin-typescript #563

Honatas opened this issue Aug 3, 2021 · 0 comments

Comments

@Honatas
Copy link

Honatas commented Aug 3, 2021

This is a Feature Proposal

Description

When using this plugin with serverless-plugin-typescript, the scriptFile will be in a different location (.build folder). We need a way to tell serverless-azure-functions to get the files from that folder.

I have just run sls create -t azure-nodejs -p and then changed the extension of the hello.js and goodbye.js files to ts, as well as installed serverless-plugin-typescript. When running serverless, I get this error: The 'hello' function is in error: Invalid script file name configuration. The 'scriptFile' property is set to a file that does not exist.

This happens because of the generated function.json, it sets "scriptFile" to the location of the .ts file. It should set it to the location of the transpiled file on .build folder. So, instead of "../src/handlers/hello.js", it should be "../.build/src/handlers/hello.js".

I have manually replaced the function.json file with the correct configuration and everything works fine. We just need it done automatically.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant