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 0c3e6eb commit ab1b4a0Copy full SHA for ab1b4a0
lib/plugin.js
@@ -8,8 +8,11 @@ export default ({ app: { router } }) => {
8
const predictions = Object.keys(guess()).sort((a, b) => a.probability - b.probability)
9
predictions.forEach(path => {
10
router.getMatchedComponents(path).forEach(Component => {
11
- if (typeof Component === 'function') {
12
- try { Component() } catch (e) {}
+ if (typeof Component === 'function' && !Component.__prefetched) {
+ try {
13
+ Component()
14
+ Component.__prefetched = true
15
+ } catch (e) {}
16
}
17
})
18
0 commit comments