File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export function resolveAsyncComponents (matched: Array<RouteRecord>): Function {
2020 pending ++
2121
2222 const resolve = once ( resolvedDef => {
23- if ( resolvedDef . __esModule && resolvedDef . default ) {
23+ if ( isESModule ( resolvedDef ) ) {
2424 resolvedDef = resolvedDef . default
2525 }
2626 // save resolved on async factory in case it's used elsewhere
@@ -86,6 +86,14 @@ export function flatten (arr: Array<any>): Array<any> {
8686 return Array . prototype . concat . apply ( [ ] , arr )
8787}
8888
89+ const hasSymbol =
90+ typeof Symbol === 'function' &&
91+ typeof Symbol . toStringTag === 'symbol'
92+
93+ function isESModule ( obj ) {
94+ return obj . __esModule || ( hasSymbol && obj [ Symbol . toStringTag ] === 'Module' )
95+ }
96+
8997// in Webpack 2, require.ensure now also returns a Promise
9098// so the resolve/reject functions may get called an extra time
9199// if the user uses an arrow function shorthand that happens to
You can’t perform that action at this time.
0 commit comments