question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Package weighs 65kb in build - Reducing bundle size of the package in a Create-React-App Typescript project.

See original GitHub issue

We use the component in an important page, where SEO and load speed are important. We would like to reduce bundle size. I am aware of #311. But when I cahnge imports to

import Player from 'react-player/lib/Player'
import YouTube from 'react-player/lib/players/YouTube'

types are not supported at all. I guess there are two solutions:

  1. Updating the types file, and typing objects in the “lib” path.
  2. Alternatively, getting an API for the Player object. Any suggestions?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
carpbencommented, Jun 20, 2020

@prochorz Your question isn’t related to the issue at all. It doesn’t belong here.
I suggest you ask it in some forum, perhaps Stack Over Flow.

1reaction
cookpetecommented, Dec 26, 2019

This should be partly addressed by the 2.0.0 alpha, which uses lazy player loading:

npm install react-player@2.0.0-alpha.0
Read more comments on GitHub >

github_iconTop Results From Across the Web

Reducing bundle size of the package in a Create-React-App ...
Package weighs 65kb in build - Reducing bundle size of the package in a Create-React-App Typescript project. #633.
Read more >
5 Methods to Reduce JavaScript Bundle Size - Bits and Pieces
In this article, I will discuss 5 techniques to reduce the JavaScript bundle size to avoid any performance bottlenecks.
Read more >
Two Quick Ways To Reduce React App's Size In Production
File size Development v/s Production. 2. Serve gzipped file in production. You can dramatically reduce the size by gzipping the bundle.js.
Read more >
Analyze your React app's bundle size and reduce it using ...
Reduce your bundle size by code-splitting​​ Instead of keeping all your code in the one bundle, you can split it up into multiple...
Read more >
Slimming down your bundle size - LogRocket Blog
A critical part for improving frontend performance is to reduce the JavaScript bundle size that should be downloaded via the network.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found