From de3331bf8a6c8dbbe30200c386ec62f0d582f261 Mon Sep 17 00:00:00 2001 From: Yuta Hiroto Date: Mon, 27 Jul 2020 14:38:09 +0900 Subject: [PATCH] chore(examples): fix util.js --- examples/util.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/util.js b/examples/util.js index e670873c6b..9a5e57ff1d 100644 --- a/examples/util.js +++ b/examples/util.js @@ -25,7 +25,7 @@ module.exports = { } const result = Object.assign(defaults, config); - const before = function before(app) { + const onBeforeSetupMiddleware = ({ app }) => { app.get('/.assets/*', (req, res) => { const filename = path.join(__dirname, '/', req.path); res.sendFile(filename); @@ -74,14 +74,14 @@ module.exports = { }) ); - if (result.devServer.before) { - const proxy = result.devServer.before; - result.devServer.before = function replace(app) { - before(app); + if (result.devServer.onBeforeSetupMiddleware) { + const proxy = result.devServer.onBeforeSetupMiddleware; + result.devServer.onBeforeSetupMiddleware = function replace(app) { + onBeforeSetupMiddleware(app); proxy(app); }; } else { - result.devServer.before = before; + result.devServer.onBeforeSetupMiddleware = onBeforeSetupMiddleware; } const output = {