Skip to content

Commit 177059b

Browse files
author
Guillaume Chau
committed
fix(ui): client addon serve
1 parent a602b2c commit 177059b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/@vue/cli-ui/src/graphql-api/connectors/client-addons.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,14 @@ function serve (req, res) {
5050
const addon = findOne(id)
5151
if (addon) {
5252
const basePath = getBasePath(require.resolve(addon.path || ''))
53-
basePath && res.sendFile(path.join(basePath, file))
54-
} else {
55-
res.status(404)
56-
res.send(`Addon ${id} not found in loaded addons. Try opening a vue-cli project first?`)
53+
if (basePath) {
54+
res.sendFile(path.join(basePath, file))
55+
return
56+
}
5757
}
58+
59+
res.status(404)
60+
res.send(`Addon ${id} not found in loaded addons. Try opening a vue-cli project first?`)
5861
}
5962

6063
module.exports = {

0 commit comments

Comments
 (0)