-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Unexpected token, You may need an appropriate loader to handle this file type. #3685
Comments
you should ship compiled code in your npm package, not raw jsx, since babel/other loaders don't run on anything inside node_modules. |
Solve, thanks.
|
Usually it is not a great idea to compile everything with babel since it will slow compilation time. Almost all code you're using from I would suggest you to process your package code with Rollup to achieve smallest output possible and point |
Hi @miraage thanks for the info. Im doing a UI kit in react, or maybe i can do this?
or i need to build my ui kit before publish in npm. any tips? thanks. |
You need to compile code before publishing. People who use your library shouldn’t need to configure anything to use it. Here’s a tool that you can use to do that: https://github.com/insin/nwb |
Many thanks for the info @gaearon |
I've published React Native packages with JSX no problem. Guess this is just a React thing? |
@threepointone or @justinlazaro-ubidy Please can you share file path where i can put my changes for this issue thanks |
This is a create-react-app limitation See also: - facebook/create-react-app#1333 - facebook/create-react-app#3685 - facebook/create-react-app#4161
Just created an npm package, and when i use it on my project created by create-react-app
got error, any thoughts?
my npm package
The text was updated successfully, but these errors were encountered: