fix(ui): webpack logo

This commit is contained in:
Guillaume Chau
2018-06-30 14:25:41 +02:00
parent c8224de582
commit c2c5e37ea6
2 changed files with 9 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ const { clientAddonConfig } = require('@vue/cli-ui')
module.exports = {
...clientAddonConfig({
id: 'vue-webpack'
id: 'org.vue.webpack.client-addon'
// port: 8042
})
}

View File

@@ -53,15 +53,18 @@ function serve (req, res) {
const { id, 0: file } = req.params
const addon = findOne(decodeURIComponent(id))
if (addon && addon.path) {
const basePath = resolveModuleRoot(require.resolve(addon.path))
const resolvedPath = require.resolve(addon.path)
const basePath = resolveModuleRoot(resolvedPath)
if (basePath) {
res.sendFile(path.join(basePath, file))
return
} else {
res.status(404)
res.send(`File not found (resolved: ${resolvedPath}`)
}
} else {
res.status(404)
res.send(`Addon ${id} not found in loaded addons. Try opening a vue-cli project first?`)
}
res.status(404)
res.send(`Addon ${id} not found in loaded addons. Try opening a vue-cli project first?`)
}
module.exports = {