Skip to content

feat: Dynamic imports#2

Draft
fayazara wants to merge 2 commits intomainfrom
feat-dynamic-imports
Draft

feat: Dynamic imports#2
fayazara wants to merge 2 commits intomainfrom
feat-dynamic-imports

Conversation

@fayazara
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
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. 🙂

Comment thread build.config.ts

export default defineBuildConfig({
entries: [
"src/index.ts",
Copy link
Copy Markdown
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",

Comment thread build.config.ts
export default defineBuildConfig({
entries: [
"src/index.ts",
{
Copy link
Copy Markdown
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.

@productdevbook
Copy link
Copy Markdown

To achieve this you have to build a plugin system

@fayazara
Copy link
Copy Markdown
Contributor Author

Yes, I thought of making an adapter system but I dont have the bandwidth to pick this up.

Here are a few things I have planned

  1. Improve the performance - remove ofetch dependency so package becomes smaller
  2. Make a plug and play adapter system so you dont need all the unnecessary packages

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