Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport ESM modules #267
Support ESM modules #267
Comments
|
For whoever takes this, https://github.com/fastify/fastify-autoload has all the necessary examples on how to load both cjs and mjs. |
|
Hi, can I grab this? looking for my first contribution @mcollina |
|
go for it! |
|
I would be happy to review that PR :) |
|
I am sorry but I see I would be fairly busy for the next month at least. if someone else would like to implement he/she should go for it... |
Support ESM module
Motivation
In the node14 the ESM modules will be no longer experimental
Example
And then run it with
fastify start demo.mjsThis feature should:
mjsor thetypein the package.json ismoduleThe watching feature should be updated accordingly.
To support node10, it will be needed a
--esm--no-esmflag because it doesn't support thetype:moduleloading as node>=12 does