Skip to content

issue: Add the example code using ESM #544#556

Open
44xtc44 wants to merge 1 commit intofastify:mainfrom
44xtc44:update_docu
Open

issue: Add the example code using ESM #544#556
44xtc44 wants to merge 1 commit intofastify:mainfrom
44xtc44:update_docu

Conversation

@44xtc44
Copy link

@44xtc44 44xtc44 commented Feb 4, 2026

README.md updated.
Tests for plugin ES modules exist already on fastify's repository at /test/esm.

Please confirm or reject.
Thank you

Checklist

const fastify = Fastify({ logger: true });

fastify.register(import("@fastify/static"), {
root: path.join(__dirname, "public"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
root: path.join(__dirname, "public"),
root: path.join(import.meta.dirname, "public"),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants