Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not use require.main in cli preset #2538

Closed
wants to merge 4 commits into from

Conversation

jrutila
Copy link
Contributor

@jrutila jrutila commented Jun 17, 2024

πŸ”— Linked issue

Part of implementing #2466

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The generated server/index.mjs is no longer dependent on the require. I don't think there is a valid way to check if the file is the main with ES modules?

Also, it uses Object.entries for result headers.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

renovate bot and others added 2 commits June 14, 2024 11:49
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@pi0
Copy link
Member

pi0 commented Jun 17, 2024

Would you please rebase it to v2 branch?

Also trick for ESM main check: https://github.com/unjs/unenv/blob/main/test/node-coverage.ts#L75

@jrutila
Copy link
Contributor Author

jrutila commented Jun 17, 2024

Uhh... sorry, need to fix more...

@jrutila jrutila closed this Jun 17, 2024
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.

3 participants