WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

[v3]: Allow the server.ts entry to export other content. #3833

@medz

Description

@medz

Describe the feature

For example, in Cloudflare workers, when combined with workflows, Cloudflare requires exporting the implementation class of WorkerEntrypoint in the entry file. Currently, Nitro 3 does not support exporting from anywhere.

We could create a new entry file and import .output/server/index.mjs, but this has a problem: if we use the same things in the new entry file as in Nitro 3 (e.g., ORM), the code will be packaged and deployed twice.

My workaround is to allow exporting content from server.ts. After a Nitro build, this will also be exported to .output/server/index.mjs.


I'd love to help with this, but I haven't found any documentation or anything related to the Nitro plugin. Of course, I don't want to rely on AI to do it.

Additional information

  • Would you be willing to help implement this feature?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions