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: Dynamic imports #2

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

feat: Dynamic imports #2

wants to merge 2 commits into from

Conversation

fayazara
Copy link
Contributor

No description provided.

Copy link
Contributor

@johannschopplich johannschopplich left a comment

Choose a reason for hiding this comment

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

This might be simpler. Untested, however. 🙂


export default defineBuildConfig({
entries: [
"src/index.ts",
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need the extension:

Suggested change
"src/index.ts",
"src/index",

export default defineBuildConfig({
entries: [
"src/index.ts",
{
Copy link
Contributor

@johannschopplich johannschopplich Oct 24, 2024

Choose a reason for hiding this comment

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

Actually, using mkdist might be overcomplicating things. Could you please try just referencing all source files like services/resend in the entries option?

Like this:

export default defineBuildConfig({
  entries: [
    "src/index",
    "src/services/resend",
    "src/services/plunk"
    // etc.
  ],
  // You should now be able to omit the `externals`!
}

Rollup should automatically resolve these as separate chunks.

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