mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-03-16 06:33:19 -05:00
fix(ui): clear client addons on PluginApi reset
This commit is contained in:
@@ -39,6 +39,12 @@ function remove (id, context) {
|
||||
if (index !== -1) addons.splice(index, 1)
|
||||
}
|
||||
|
||||
function clear (context) {
|
||||
for (const addon of addons) {
|
||||
remove(addon.id, context)
|
||||
}
|
||||
}
|
||||
|
||||
function getUrl (addon, context) {
|
||||
return addon.url || `${baseUrl}/_addon/${addon.id}/index.js`
|
||||
}
|
||||
@@ -64,5 +70,6 @@ module.exports = {
|
||||
remove,
|
||||
findOne,
|
||||
getUrl,
|
||||
serve
|
||||
serve,
|
||||
clear
|
||||
}
|
||||
|
||||
@@ -102,6 +102,7 @@ function resetPluginApi (context) {
|
||||
}
|
||||
sharedData.unWatchAll()
|
||||
|
||||
clientAddons.clear(context)
|
||||
suggestions.clear(context)
|
||||
|
||||
pluginApi = new PluginApi({
|
||||
|
||||
Reference in New Issue
Block a user