Skip to content

Commit 92e0270

Browse files
authored
Merge pull request #53 from rhythnic/middleware-order
Put hotMiddleware before proxyMiddleware in dev server
2 parents 92dc0bd + d208a70 commit 92e0270

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
@@ -43,6 +43,10 @@ compiler.plugin('compilation', function (compilation) {
4343
})
4444
})
4545

46+
// enable hot-reload and state-preserving
47+
// compilation error display
48+
app.use(hotMiddleware)
49+
4650
// proxy api requests
4751
Object.keys(proxyTable).forEach(function (context) {
4852
let options = proxyTable[context]
@@ -58,10 +62,6 @@ app.use(require('connect-history-api-fallback')())
5862
// serve webpack bundle output
5963
app.use(devMiddleware)
6064

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

0 commit comments

Comments
 (0)