michaelcontento / redux-storage

Persistence layer for redux with flexible backends
MIT License
675 stars 50 forks source link

es6 / rollup / require is undefined #168

Closed duydao closed 7 years ago

duydao commented 7 years ago

I'm having problems loading redux-storage as es6-module with rollup.js in ionic. The generated code for https://github.com/michaelcontento/redux-storage/blob/master/src/index.js#L6-L12 (build-es/index.js) throws an error in the browser:

// The full default export is required to be BC with redux-storage <= v1.3.2
export default _extends({}, require('./constants'), {
    createLoader: require('./createLoader')['default'],
    createMiddleware: require('./createMiddleware')['default'],
    reducer: require('./reducer')['default']
});

Removing that part from the generated file will resolve this problem. Is this code still required?

michaelcontento commented 7 years ago

Sorry for the bad news but this package is no longer maintained. 😞

My focus has left the react / node ecosystem and I don't have to time to keep things up to date. But if you want to step in and become the new maintainer of redux-storage and all of it parts, just ping me! 😃

michaelcontento commented 7 years ago

Re-opened as @guns2410 want's to work on this project: Give him a warm welcome 👏

guns2410 commented 7 years ago

Thanks @michaelcontento

@duydao can you confirm if rollup-plugin-commonjs resolves your issue.

I was able to find an issue on rollup.js

duydao commented 7 years ago

pretty sure it happened with 5.0.4, but ionic jumped the ship and is using webpack now. Thanks looking into it though!