insin / react-hn

React-powered Hacker News client
https://insin.github.io/react-hn
Other
2.18k stars 329 forks source link

Reloading development server #84

Open aleyan opened 7 years ago

aleyan commented 7 years ago

I am trying to run a development server locally and code doesn't appear to reload code in the browser on save of file or on reload of browser. This happens when I run the server with npm run start.

Alternatively I have tried running a development server using nwb with npm run serve and then the code reloading does work. However, in this case no css is loaded and the index html is more bare than expected and of providence that I can't figure out:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>react-hn</title>
  </head>
  <body>
    <div id="app"></div>
  <script type="text/javascript" src="/core.js"></script><script type="text/javascript" src="/app.js"></script></body>
</html>

I am running this on MacOS

$ npm --version
4.6.1
$ node --version
v6.10.3
aleyan commented 7 years ago

Ok, I figured out how to get npm run serve working. The trouble was nwb was using its own default "index.html" to start the app with. I changed HtmlWebpackPlugin plugin to compile views/index.ejs to it instead in #85. Am I doing the right thing @insin?