gaearon / react-hot-boilerplate

Minimal live-editing example for React
MIT License
3.91k stars 879 forks source link

Modify webpack.config.js so output.path matches output.publicPath. #10

Closed lancefisher closed 9 years ago

lancefisher commented 9 years ago

This is a minor fix that I noticed while using react-hot-boilerplate as a guide to enable hot loading on my own project.

Thanks for a great example!

Problem

Running webpack at the command line generates ./bundle.js. However, index.html expects /scripts/bundle.js (where the dev server serves it).

Fix

Append '/scripts/' to output.path in webpack.config. This will create a scripts directory and place bundle.js in it when running webpack at the CLI.

gaearon commented 9 years ago

Good catch. Thanks!