提交 25668347 编写于 作者: 王集鹄 提交者: 偏右

Simplify the code and update the comments (#809)

https://webpack.github.io/docs/context.html The webpack 1.x documentation was deleted.
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册