New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy loading #35
Comments
Hi @dan-gamble - I haven't used Nuxt.js much but @Atinux and I discussed this a lot a few weeks ago so based on that my assumption is it should be possible - and the in the code it looks like it is the default for the client build: https://github.com/nuxt/nuxt.js/blob/master/lib/app/router.js#L9 |
@dan-gamble if you want to use highlight.js only on a specific page component, juste import it in your page component:
<script>
import highlightjs from 'highlight.js'
export default {
}
</script> Make sure that you don't use This way, highlight.js will be in the bundle of the /about page and we will be imported only when loading this route 👍 This is due to the code splitting we define in the router of Nuxt.js, like @declandewet described in his comment. |
Awesome, thanks guys. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is it possible to only execute certain bits of code like we can with base webpack or vue-router
require.ensure
,System.import
? If so would this be possible aftergenerate
too?My use case is using
highlight.js
but i'd only wanna load this on certain routesThe text was updated successfully, but these errors were encountered: