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

Bundle size and tree shaking not working properly #1478

Open
evadeharomunoz opened this issue Oct 22, 2024 · 1 comment
Open

Bundle size and tree shaking not working properly #1478

evadeharomunoz opened this issue Oct 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@evadeharomunoz
Copy link

Current Behavior:

I've installed Vidstack into a Next js (v14.1.0) monorepo.
To my surprise when I build the project and see the weight using the nextjs-bundle-analyzer I'm seeing that Vidstack bundle it weighs more than 600kb.
Reading docs I can see that tree shaking is accepted. But it doesn't seem to be working because the weight of the bundle is not decreasing whatever I do.

I'm doing the imports this way:

import { Controls, MediaPlayer, MediaProvider } from '@vidstack/react'

If I try to make imports similar to the ones below, the library does not expect them.

import { Controls } from '@vidstack/react/player'
import { Controls } from '@vidstack/player'

Is there something I am missing to remove all of the unused components from my bundle?
Thanks!

Environment:

  • Framework: React
  • Meta Framework: Next.js
  • Node: 20.15.1
  • Device: Macbook
  • Browser: Chrome

Captura de Pantalla 2024-10-18 a las 17 21 43

Captura de Pantalla 2024-10-22 a las 9 37 16

@evadeharomunoz evadeharomunoz added the bug Something isn't working label Oct 22, 2024
@SantiagoRangel
Copy link

I have been running into the same issue with a project last month. At the end I decided change the whole stack :(

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

No branches or pull requests

2 participants