Skip to content

Commit 6477757

Browse files
Nick BaroniLinusBorg
authored andcommitted
Put hotMiddleware before proxyMiddleware in dev server (#837)
1 parent b911e67 commit 6477757

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

template/build/dev-server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ const hotMiddleware = require('webpack-hot-middleware')(compiler, {
4545
// })
4646
// })
4747

48+
// enable hot-reload and state-preserving
49+
// compilation error display
50+
app.use(hotMiddleware)
51+
4852
// proxy api requests
4953
Object.keys(proxyTable).forEach(function (context) {
5054
const options = proxyTable[context]
@@ -60,10 +64,6 @@ app.use(require('connect-history-api-fallback')())
6064
// serve webpack bundle output
6165
app.use(devMiddleware)
6266

63-
// enable hot-reload and state-preserving
64-
// compilation error display
65-
app.use(hotMiddleware)
66-
6767
// serve pure static assets
6868
const staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
6969
app.use(staticPath, express.static('./static'))

0 commit comments

Comments
 (0)