@venkiiitk , you are missing syntax. Your index.mjs must look like this
import {generate} from 'critical'
function main(params) {
const logger = Core.Logger("main", { level: params.LOG_LEVEL || "info" });
logger.info("Hello world runtime action");
return {
statusCode: 200,
headers: {
'Content-Type': 'application/json'
},
body: {
LOG_LEVEL: params.LOG_LEVEL,
message: 'this is a test message'
}
}
}
const _main = main;
export { _main as main };
Key is, default export must look like
`export { _main as main };`
I dono why. But boilerplate expects in exact syntax. From index.mjs, we can create other *.mjs and write esm code. works fine.