Kikobeats / react-clap-button

A Medium like clap button
https://react-clap-button.netlify.com
120 stars 17 forks source link

npm package does not install correctly #48

Closed tmaximini closed 4 years ago

tmaximini commented 4 years ago
Bildschirmfoto 2020-02-08 um 10 50 07

sh: babel: command not found - I assume this is because of the postinstall npm script which calls npm run build on the machine it installs to, and babel is just a dev dependency. not everyone using this package will have babel installed. Why not babel it before publishing?

Kikobeats commented 4 years ago

yep, you're right, I think postinstall can be removed since this module was written in ES6, so using it in a common react workflow means eventually will be transpiled according to with every project babel settings.

Can you make a PR? also this lib reference need to be removed https://github.com/Kikobeats/react-clap-button/blob/master/package.json#L6

tmaximini commented 4 years ago

ok, I will make a PR 👍

tmaximini commented 4 years ago

The problem is that most workflows do not transpile stuff from node_modules again. I think pre-publish transpilation and then only publish /lib would be the way to go.

Kikobeats commented 4 years ago

@tmaximini

I took your PR as inspiration and I improved bundle system at react-clap-button@1.2.1

https://github.com/Kikobeats/react-clap-button/commit/f311545c071c45d3391048e387c29275f58a0301

Can you told me if it's working fine for you?

tmaximini commented 4 years ago

yes, works perfectly now!

Kikobeats commented 4 years ago

awesome 🎉