unirakun / k-redux-factory

Factory of Redux reducers and their associated actions and selectors.
MIT License
18 stars 4 forks source link

help the developpers to detect that there is 2 reducer with same name/prefix #79

Open fabienjuif opened 6 years ago

fabienjuif commented 6 years ago

Only in development builds:

@bpetetot are you ok ?

This is related to #73 that is coming back on a regular basis

bpetetot commented 6 years ago

Yes it seems good to me and useful to avoid problems to avoid name collisions

fabienjuif commented 6 years ago

@bpetetot do you know how to handle dev/prod build from a library perspective ?

bpetetot commented 6 years ago

In ReactJS, they build 2 differents bundles: react.development.js and react.production.js With the following index.js file:

'use strict';

if (process.env.NODE_ENV === 'production') {
  module.exports = require('./cjs/react.production.min.js');
} else {
  module.exports = require('./cjs/react.development.js');
}
fabienjuif commented 6 years ago

Hmm ok, so we have to build 2 times the libs:

And add this index.js manually

bpetetot commented 6 years ago

I think you can directly build dev and prod bundles through the rollup config. So you will not have to call 2 times the yarn build command.

fabienjuif commented 6 years ago

I move the lib to microbundle