adrienjt / redux-data-structures

Reducer factory functions for common data structures: counters, maps, lists (queues, stacks), sets, etc.
https://redux-data-structures.js.org
MIT License
157 stars 4 forks source link

Issue Building With Create React App #4

Closed bfillmer closed 7 years ago

bfillmer commented 7 years ago

When using redux-data-structures in a Create React App based system development works fine. However when creating a production build using yarn build an UglifyJS error pops up:

screen shot 2017-08-08 at 10 06 38 am

Looks like an issue with Uglification on the defaults set inside the function definitions.

Interestingly cloning the redux-data-structures repository into a sub-directory of src in the app, building it, and linking directly to es6/index.js works just fine for both development and production build.

nickserv commented 7 years ago

I get the same with npm run build using react-scripts@1.0.11.

adrienjt commented 7 years ago

Sorry about that guys and thank you for your feedback. I'll try a fix tomorrow.

adrienjt commented 7 years ago

UglifyJS doesn't support ES6, and Create React App and react-scripts haven't switched to Babel-Minify (Babili) yet. So I'd need to transpile even the es/ export. Hopefully early next week I'll publish a fix for you guys. In the meantime, copy-pasting the library like @bfillmer did is the simplest workaround.

Reference: https://github.com/rollup/rollup/wiki/pkg.module#wait-it-just-means-import-and-export--not-other-future-javascript-features