Skip to content

Commit

Permalink
index.html can be inlined
Browse files Browse the repository at this point in the history
  • Loading branch information
ericclemmons committed Jan 24, 2016
1 parent d302c39 commit ffd0537
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
8 changes: 0 additions & 8 deletions example/src/public/index.html

This file was deleted.

20 changes: 12 additions & 8 deletions example/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@ import webpack from "webpack";

import client from "../webpack.config.client.babel";

const app = express();
const compiler = webpack(client);

app
.use(express.static("build/client"))
.use(express.static("src/public"))
export default express()
.get("/", (req, res) => res.send(`
<!doctype html>
<div id="app">
Waiting on <code>client.js</code> to execute...
</div>
<script src="client.js"></script>
`))
.use(require("webpack-dev-middleware")(compiler, {
noInfo: true,
publicPath: client.output.publicPath,
quiet: false,
}))
.use(require("webpack-hot-middleware")(compiler, { reload: true }))
.use(require("webpack-hot-middleware")(compiler))
.listen(3000, (err) => {
if (err) {
console.error(err);
return;
return console.error(err);
}

console.log("Listening on http://localhost:3000/");
console.info("Listening on http://localhost:3000/")
})
;

0 comments on commit ffd0537

Please sign in to comment.