Skip to content

Commit

Permalink
Add hot reloading to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed May 7, 2015
1 parent 130e242 commit e897fc8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 43 deletions.
2 changes: 1 addition & 1 deletion scripts/startSiteDevServer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ rm -rf ./__site__
rm -rf ./__site_prerender__
webpack --config "$PWD/site/webpack-prerender.config.js"
./scripts/buildSiteIndexPages.sh
webpack-dev-server --config "$PWD/site/webpack-client.config.js" --no-info --content-base __site__
webpack-dev-server --config "$PWD/site/webpack-client.config.js" --no-info --hot --content-base __site__
4 changes: 1 addition & 3 deletions site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ npm install
Then, run the server via

```
npm run site-dev-server
npm start
Open http://localhost:8080/
```

Anytime you change the contents, just refresh the page and it's going to be updated.

# Publish the website

Just run the publish script, this will setup your environment if it's not already then it'll automatically build a static version of the site and publish it to gh-pages.
Expand Down
37 changes: 0 additions & 37 deletions site/npm-debug.log

This file was deleted.

8 changes: 6 additions & 2 deletions site/webpack-client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ module.exports = {

devtool: 'source-map',

entry: path.join(__dirname, 'client.js'),
entry: [
path.join(__dirname, 'client.js'),
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server'
],

output: {
path: '__site__/',
Expand All @@ -31,7 +35,7 @@ module.exports = {
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
loaders: ['react-hot-loader', 'babel-loader']
},
{
test: /\.css$/,
Expand Down

0 comments on commit e897fc8

Please sign in to comment.