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

feat: enabled tsup code splitting and esm directory import, removed manual copy of files #1362

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

akhilmhdh
Copy link
Member

@akhilmhdh akhilmhdh commented Feb 2, 2024

Description 📣

  1. Enabled tsup to output the esm module that any nodejs can run without anything else
  2. Support for directory import in esm
  3. No more manual copy of files
  4. Resolve one tiny bug in signup with this PR where setting refresh cookie should not be awaited
  5. Made api docs available in standalone

Type ✨

  • Bug fix
  • New feature
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@akhilmhdh akhilmhdh added the 🐞 bug Something isn't working label Feb 2, 2024
@akhilmhdh akhilmhdh self-assigned this Feb 2, 2024
// tsc is great for final build issue is we need to then do a manual copy of all static files like handlebar email etc
// another issue is commonjs. final output needs to be esm because more and more packages are migrating to esm
// if the final output is commonjs it will just throw an error
// the below configuration is best of both worlds
Copy link
Collaborator

Choose a reason for hiding this comment

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

Had some diffuclates understahding this:


// Instead of using tsx or tsc for building, consider using tsup.
// TSX serves as an alternative to Node.js, allowing you to build directly on the Node.js runtime.
// Its functionality mirrors Node.js, with the only difference being the absence of a final build step. Production should ideally be launched with TSX.
// TSC is effective for creating a final build, but it requires manual copying of all static files such as handlebars, emails, etc.
// A significant challenge is the shift towards ESM, as more packages are adopting ESM. If the output is in CommonJS, it may lead to errors.
// The suggested configuration offers a balance, accommodating both ESM and CommonJS requirements.

@maidul98 maidul98 merged commit 2d1b60a into Infisical:main Feb 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants