survivejs / webpack-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/webpack/
2.42k stars 319 forks source link

Error with path component in the index.js page 6 #271

Closed wirtaw closed 7 years ago

wirtaw commented 7 years ago

When try make bundle with node_modules/.bin/webpack ERROR in ./app/index.js Module not found: Error: Can't resolve './component' in 'xxxxxxxx/webpack-demo/app' @ ./app/index.js 1:0-36 get error If add to import directory at index.js from './component/component.js' then it make bundle without errors

bebraw commented 7 years ago

Hi,

Can you push a project showing the issue to GitHub? It's easier to debug then.

wirtaw commented 7 years ago

Hi, Yes, I can. Where is webpack-demo

bebraw commented 7 years ago

Hi,

Alter the app directory so that it looks like this:

app $ tree
.
├── component.js
└── index.js

That will fix the import.

wirtaw commented 7 years ago

Yes, it also helps. Thank you!

bebraw commented 7 years ago

No probs. I'm not sure if you noticed but I have a sort of summary of the content online in form of slides. Maybe that helps. We also have a little chat.