Skip to content

Lazy loading components #27067

Discussion options

You must be logged in to vote

If have have Component2 inside Component 1, then yes it will be included in the Component 1 bundle and lazy loaded.

If you have Component2 passed into the slot of Component1 (which you seem to be doing above) then no. If you're using slots, then you'd put 'Lazy' in front of Cart and it would be bundled into it's own separate file and lazy loaded.

You can play with this all yourself just as I did by making 2 components with distinct text in them and then building your project an inspecting the JS contents via the Network Tab in your browser (and then search)

In chrome, it's cmd+f on a mac while in the network tab in devtools.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dbzx10299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants