UNPKG

serverless

Version:

Serverless Framework - Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more

14 lines (12 loc) 306 B
'use strict'; module.exports = async (modPath) => { try { return require(modPath); } catch (error) { // Fallback to import() if the runtime supports native ESM if (error.code === 'ERR_REQUIRE_ESM') { return (await import(`file:///${modPath}`)).default; } throw error; } };