Skip to content

Commit 3eb5116

Browse files
author
Guillaume Chau
committed
fix(ui): clear client addons on PluginApi reset
1 parent c2da5fc commit 3eb5116

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ function remove (id, context) {
3939
if (index !== -1) addons.splice(index, 1)
4040
}
4141

42+
function clear (context) {
43+
for (const addon of addons) {
44+
remove(addon.id, context)
45+
}
46+
}
47+
4248
function getUrl (addon, context) {
4349
return addon.url || `${baseUrl}/_addon/${addon.id}/index.js`
4450
}
@@ -64,5 +70,6 @@ module.exports = {
6470
remove,
6571
findOne,
6672
getUrl,
67-
serve
73+
serve,
74+
clear
6875
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ function resetPluginApi (context) {
102102
}
103103
sharedData.unWatchAll()
104104

105+
clientAddons.clear(context)
105106
suggestions.clear(context)
106107

107108
pluginApi = new PluginApi({

0 commit comments

Comments
 (0)