survivejs / webpack-book

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

absolute path import doesn't work #62

Closed eyalw closed 8 years ago

eyalw commented 8 years ago

hey, it seems absolute import doesnt work for me. what happens is that webpack translates the require('/whatever') to a url, and my server tries to load it, instead of webpack importing it. https://github.com/christianalfoni/react-webpack-cookbook/wiki/Requiring-files

entry: [ './client/scripts/index.js', 'webpack-hot-middleware/client', ],

bebraw commented 8 years ago

Did you manage to resolve this? If you want require('whatever'), you can set resolve.root.

I'm currently rewriting the book btw. As that particular chapter went away and the statement isn't there anymore, I'm closing this. Feel free to continue conversation, though.