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

Split bundle to allow for import without Shoelace components #32

Open
spwoodcock opened this issue Jun 6, 2024 · 0 comments
Open

Split bundle to allow for import without Shoelace components #32

spwoodcock opened this issue Jun 6, 2024 · 0 comments
Labels
build Changes to build tooling or compiled dist enhancement New feature or request

Comments

@spwoodcock
Copy link
Member

spwoodcock commented Jun 6, 2024

Is your feature request related to a problem? Please describe.

  • Currently importing the components.js bundle imports all Shoelace components and composite HOT components together.
// Build stats
dist/style.css       27.95 kB │ gzip:   6.33 kB
dist/components.js  587.93 kB │ gzip: 130.64 kB
  • The components bundle may be a bit heavy if not everything is needed.

Describe the solution you'd like

  • Create two Vite config files, with different outputs.
  • One should generate a bundle with only the HOT composite components (which includes the required Shoelace component dependencies).
  • Another should generate the bundle as it is now, with everything together, about 500kb.
  • Ideally have three files: HOT composite components, Shoelace exports, a file to wrap the two and export both.

Additional info

  • This only affects the bundles.
  • Importing the individual ES Modules is much more efficient if only a few components are required.
@spwoodcock spwoodcock added the enhancement New feature or request label Jun 6, 2024
@spwoodcock spwoodcock added the build Changes to build tooling or compiled dist label Jun 27, 2024
@spwoodcock spwoodcock moved this to Backlog in Shared UI Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Changes to build tooling or compiled dist enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant