Skip to content

Commit 4d28b34

Browse files
committed
fix(devtools): refresh devtools when state changes
1 parent 0295650 commit 4d28b34

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

build/config.js

+7
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ const genConfig = (name) => {
9696
plugins: [
9797
replace({
9898
delimiters: ['', ''],
99+
// Patch devtools flush calls to use the global hook
100+
// rather than the devtools variable
101+
// which is undefined in most cases
102+
// and non-reactive
103+
'devtools && config.devtools': 'global.__VUE_DEVTOOLS_GLOBAL_HOOK__ && config.devtools',
104+
'devtools.emit(\'flush\')': 'global.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit(\'flush\')',
105+
99106
// Replace empty .vue file components default element to avoid crashes
100107
'_c("div")': '_c("NativeContentView")'
101108
}),

0 commit comments

Comments
 (0)