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

add unbundled es6 build with jsx file extensions #1537

Merged
merged 3 commits into from
Feb 3, 2023

Conversation

DouglasDev
Copy link
Contributor

Fixes: #1443

This command copies the src files to a directory called 'es6', excluding the demo directory, and renames 'js' files to 'jsx' files if they use jsx. This can then be imported into a project that uses vite this way:

import ReactPlayer from 'react-player/es6'; 

This should allow lazy imports as well.

Perhaps the readme should be updated? Not sure what exactly to write.

@solidiquis
Copy link

Excited to see this merged. Just came across this problem while migrating from webpack to vite.

@wallw-teal
Copy link

wallw-teal commented Nov 11, 2022

This is good, but would also like to see a module field in package.json which points to es6/<entry>, and then you should be able to use:

import ReactPlayer from 'react-player'

with rollup or vite.

@OluAgunloye
Copy link

OluAgunloye commented Jan 18, 2023

@DouglasDev @solidiquis @wallw-teal Hello! Any idea when this will be merged?

@OluAgunloye
Copy link

Fixes: #1443

This command copies the src files to a directory called 'es6', excluding the demo directory, and renames 'js' files to 'jsx' files if they use jsx. This can then be imported into a project that uses vite this way:

import ReactPlayer from 'react-player/es6'; 

This should allow lazy imports as well.

Perhaps the readme should be updated? Not sure what exactly to write.

Write exactly what you just wrote hahaha, this solved my issue on Vite instantly.

@cookpete cookpete merged commit e10640e into cookpete:master Feb 3, 2023
@cookpete
Copy link
Owner

cookpete commented Feb 9, 2023

Published in v2.11.1

@cookpete
Copy link
Owner

This is good, but would also like to see a module field in package.json which points to es6/<entry>

Note that this was reverted in v2.11.2 because it broke things: #1574

@nemosmithasf
Copy link

@cookpete I believe you need to add typescript definitions to the es6 entry

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.

import ReactPlayer from 'react-player/lazy' fails with vite
6 participants