icd2k3/react-router-breadcrumbs-hoc

Dist files use ES6 syntax

frederikgdl opened this issue · 5 comments

I just updated to version 3.0.0 which fixed the warning issue for me (thank you!), but now i get the following error during build:

ERROR in vendors~main.ecb9379d.js from UglifyJs
Invalid assignment [./node_modules/react-router-breadcrumbs-hoc/dist/es/index.js:4277,0][vendors~main.ecb9379d.js:54665,35]

As far as I can tell this is due to the humanize-string dependency which now requires Node.js 6. Should the ES6 syntax from humanize-string be transformed on build for this project?

Hey @frederikgdl, thanks for bringing this to my attention!

FWIW there is a UMD dist output too https://github.com/icd2k3/react-router-breadcrumbs-hoc/blob/master/rollup.config.js#L28 but since you weren't seeing this issue before it does make me think something odd is going on with humanize-string 🤔

I also noticed humanize-string is adding a lot to the bundle size which is obviously not ideal...

I should have some time to look into this issue soon (hopefully by this weekend, at least).

As a short-term fix, I'll probably just downgrade humanize-string to the older version as a 3.0.1 release

Good news @frederikgdl I found a method that seems to cover all the same cases humanize-string does, so it looks like I can completely remove it as a dependency: #64

This should fix your error when it is released, and has the added benefit of dropping the build size from ~32kb (gzip) -> ~3kb (gzip)

Wow, great news! Thank you so much for your quick response and help!

No problem @frederikgdl. 3.1.0 is released and should not have humanize-string bundled with it

I upgraded and it now builds without error and works as expected. Thanks again!