mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-03-14 13:11:10 -05:00
fix(ui): client addon serve error
This commit is contained in:
@@ -49,8 +49,8 @@ function serve (req, res) {
|
||||
const { id, 0: file } = req.params
|
||||
const addon = findOne(id)
|
||||
if (addon) {
|
||||
const basePath = getBasePath(require.resolve(addon.path))
|
||||
res.sendFile(path.join(basePath, file))
|
||||
const basePath = getBasePath(require.resolve(addon.path || ''))
|
||||
basePath && res.sendFile(path.join(basePath, file))
|
||||
} else {
|
||||
res.status(404)
|
||||
res.send(`Addon ${id} not found in loaded addons. Try opening a vue-cli project first?`)
|
||||
|
||||
Reference in New Issue
Block a user