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

10 times faster compiling speed #617

Merged
merged 6 commits into from
Mar 18, 2023
Merged

10 times faster compiling speed #617

merged 6 commits into from
Mar 18, 2023

Conversation

shinokada
Copy link
Collaborator

@shinokada shinokada commented Mar 14, 2023

This update allows users who use a small number of components to shorten the compiling time:

import Alert from 'flowbite-svelte/Alert.svelte'
package files time avg
flowbite-svelte 4 23.8ms 6.0ms

If you use a normal import:

import { Alert } from 'flowbite-svelte';
package files time avg
flowbite-svelte 145 0.23s 1.6ms

Ten times faster.

The main change is to add individual exports to package.json.

 "exports": {
    "./Accordion.svelte": {
      "types": "./dist/accordions/Accordion.svelte.d.ts",
      "svelte": "./dist/accordions/Accordion.svelte"
    },
    "./AccordionItem.svelte": {
      "types": "./dist/accordions/AccordionItem.svelte.d.ts",
      "svelte": "./dist/accordions/AccordionItem.svelte"
    },
...

A new script, add-exports-to-package-json.js, is added to the scripts dir.

@stackblitz
Copy link

stackblitz bot commented Mar 14, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel
Copy link

vercel bot commented Mar 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
flowbite-svelte ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 18, 2023 at 0:35AM (UTC)
flowbite-svelte-update ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 18, 2023 at 0:35AM (UTC)

@shinokada
Copy link
Collaborator Author

@jjagielka I need your input for this PR.

@jjagielka
Copy link
Contributor

It makes complete sense. The package has grew really big and this PR would allow build in parts.
I've played with it a bit, and seems like a really good move.

I think we can proceed with it to be official.

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.

None yet

2 participants