Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(webpack_config/devServer): add dummy check for serverSideCode
Browse files Browse the repository at this point in the history
fix(webpack_config/devServer): add dummy check for `serverSideCode`
  • Loading branch information
Metnew committed Nov 3, 2017
1 parent 53c479d commit ae38d2e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions webpack_config/devServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @file
*/
import webpack from 'webpack'
import chalk from 'chalk'
import webpackDevMiddleware from 'webpack-dev-middleware'
import webpackHotMiddleware from 'webpack-hot-middleware'
import webpackGetCodeOnDone from 'webpack-get-code-on-done'
Expand Down Expand Up @@ -50,8 +51,16 @@ export default function (app) {
// Remove old compiled code
app._router.stack = stack.slice(0, prevSize)
}
// Apply newly compiled code
serverSideCode(app)
if (!serverSideCode) {
console.log(
chalk.red(
'Error: no "serverSideCode" got. Check latest changes.'
)
)
} else {
// Apply newly compiled code
serverSideCode(app)
}
}

app.use(devMiddleWare)
Expand Down

0 comments on commit ae38d2e

Please sign in to comment.