I'm trying to remove the unused code of plyr library ( plugins, controls, captions ) to reduce the bundle size.
would you add a guide on how to do tree-shaking on the library?
I've tried importing as import {setup} from "plyr" but that did not work.
I also tried importing as import Plyr from "plyr/src/js/plyr" but this gives this error:
SyntaxError: C:\VS Code Projects\kasbarg\node_modules\plyr\src\js\plyr.js: Support for the experimental syntax 'classProperties' isn't currently enabled (358:8):
356 | * Play the media, or play the advertisement (if they are not blocked)
357 | */
> 358 | play = () => {
| ^
359 | if (!is.function(this.media.play)) {
360 | return null;
361 | }
Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-class-properties (https://git.io/vb4yQ) to the 'plugins' section to enable parsing.
Hello
I'm trying to remove the unused code of
plyr
library ( plugins, controls, captions ) to reduce the bundle size.would you add a guide on how to do tree-shaking on the library?
I've tried importing as
import {setup} from "plyr"
but that did not work. I also tried importing asimport Plyr from "plyr/src/js/plyr"
but this gives this error:Thanks