webpack: Module not found: Error: Can't resolve (with relative path)

前端 未结 10 2100
长情又很酷
长情又很酷 2021-02-05 06:34

I have this structure of an app (node_modules dir excluded from this list):

├── actions.js
├── bundle.js
├── components
│   ├── App.js
│   ├── Foote         


        
10条回答
  •  难免孤独
    2021-02-05 07:25

    while importing libraries use the exact path to a file, including the directory relative to the current file, for example:

    import Footer from './Footer/index.jsx'
    import AddTodo from '../containers/AddTodo/index.jsx'
    import VisibleTodoList from '../containers/VisibleTodoList/index.jsx'
    

    Hope this may help

提交回复
热议问题