-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Labels
Description
Standards compliant way to load module is ES Modules not CommonJS in Node.
E.g. ESM Declaration
export default async function MyFunc(context) {
return {
status: 200,
body: "hello, world!\n"
};
}
ESM module use
import {MyFunc} from "my-module.mjs";
vs
CommonJS declaraion
module.exports = async function(context) {
return {
status: 200,
body: "hello, world!\n"
};
}
CommonJS use
const myModule = require("my-modules.cjs);
Is there a way to make NODE's ESM's imports / module declarations work in Fission?
Tried it locally and it did not work. Could not find any mentions/examples in your repos either
ESM is the recommended way to build Node JS code these days
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
QingJ and cheo-alvarez