Commit 25668347 authored by 王集鹄's avatar 王集鹄 Committed by 偏右

Simplify the code and update the comments (#809)

https://webpack.github.io/docs/context.html The webpack 1.x documentation was deleted.
parent d6a56da3
// Use require.context to require reducers automatically
// Ref: https://webpack.github.io/docs/context.html
// Ref: https://webpack.js.org/guides/dependency-management/#require-context
const context = require.context('./', false, /\.js$/);
const keys = context.keys().filter(item => item !== './index.js');
const models = [];
for (let i = 0; i < keys.length; i += 1) {
models.push(context(keys[i]));
}
export default models;
export default context.keys().filter(item => item !== './index.js').map(key => context(key));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment