我使用Webpack(2.2)创建嵌套导入。
//This is a separate npm package called 'input-field'
//InputField index.js
export default {}; //exports empty object
//This is a another separate npm package called 'todo-list'
//TodoList index.js, runs npm install --save input-field
import InputField from 'input-field';
export default {}; //export empty object
//finally this is the project that uses todo-list
//WebpackEntryPoint, runs npm install --save todo-list;
import TodoList from 'todo-list
所以这里发生了什么:(当尝试使用webpack构建时)
1. webpack按预期解析todo-list
2. webpack无法解决'输入字段'
所以我的问题:
构建文件树时Webpack如何解析导入? 这种行为是可配置的吗?