Home

Issue: 2027

Async load component?

[issue link]

I want load vue-awesome-swiper full asynchronously (include css) for optimize first time load site (load speed). Exclude plugins, modules, because it loading before site loaded. I need it async,later. How i can do this?

// TEMPLATE (pug)
no-ssr
        vue-awesome-swiper
// SCRIPT
  let VueAwesomeSwiper
  if (process.browser) {
    VueAwesomeSwiper = require('vue-awesome-swiper/ssr')
  }

  export default{
    components: {VueAwesomeSwiper}
  }
// STYLE (stylus)
@import "swiper/dist/css/swiper.css"

And how cache it for used on another pages? what problems can there be?

This question is available on Nuxt.js community (#c1801)