Ok, was able to play around with this myself and found that I just needed the esbuild bundler.
Here is my netlify.toml
[build]
publish = "dist/"
command = "yarn build"
[build.environment]
NODE_VERSION = "14.16.0"
[functions]
directory = ".netlify/functions"
node_bundler = "esbuild"
hello-world.js
const handler = async (event) => {
try {
const subject = event.queryStringParameters.name || 'World'
return {
statusCode: 200,
body: JSON.stringify({ message: `Hello ${subject}` }),
}
} catch (error) {
return { statusCode: 500, body: error.toString() }
}
}
export { handler };
And you can see it here
https://nifty-franklin-58beda.netlify.app/.netlify/functions/hello-world