We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93c1a50 commit cbc3f90Copy full SHA for cbc3f90
src/util/env.js
@@ -83,10 +83,14 @@ export const nextTick = (function () {
83
counter = (counter + 1) % 2
84
textNode.data = counter
85
}
86
- } else if (typeof setImmediate === 'function') {
87
- timerFunc = setImmediate
88
} else {
89
- timerFunc = setTimeout
+ // webpack attempts to inject a shim for setImmediate
+ // if it is used as a global, so we have to work around that to
+ // avoid bundling unnecessary code.
90
+ const context = inBrowser
91
+ ? window
92
+ : typeof global !== 'undefined' ? global : {}
93
+ timerFunc = context.setImmediate || setTimeout
94
95
return function (cb, ctx) {
96
var func = ctx
0 commit comments