Getting started

Using nuxt-lazyload-files

Installation

  1. Install nuxt-lazyload-files dependency to your project:
bun
bunx nuxi@latest module add nuxt-lazyload-css
yarn
yarn dlx nuxi@latest module add nuxt-lazyload-css
npm
npx nuxi@latest module add nuxt-lazyload-css
  1. Add it to your modules section in your nuxt.config:
nuxt.config (Nuxt 3)
export default defineNuxtConfig({
  modules: ["nuxt-lazyload-files"],
});

Options

  1. Configure module by using the lazyLoadFiles property in nuxt.config:
nuxt.config
export default defineNuxtConfig({
  lazyLoadFiles: {
    // Options
  },
});

It is also possible to add the options directly in the module declaration:

nuxt.config
export default defineNuxtConfig({
  modules: [
    [
      "@nuxtjs/google-fonts",
      {
       // options
      },
    ],
  ],
});
✨ And that's it! Now the defined files will load lazily based on the rules configured

Play online

You can start playing with Docus in your browser using Stackblitz:

Play on StackBlitz