UNPKG

nuxt-swiper

Version:

[![npm](https://img.shields.io/npm/v/nuxt-swiper?style=flat-square)](https://www.npmjs.com/package/nuxt-swiper/) [![Downloads](https://img.shields.io/npm/dt/nuxt-swiper.svg?style=flat-square)](https://www.npmjs.com/package/nuxt-swiper) [![License](https:/

13 lines (12 loc) 393 B
import { defineNuxtPlugin, useAppConfig } from "#imports"; export default defineNuxtPlugin((nuxtApp) => { const appConfig = useAppConfig(); nuxtApp.hook("app:created", async () => { const isBundle = appConfig.__swiper.bundled; if (!isBundle) { (await import("swiper/element")).register(); return; } (await import("swiper/element/bundle")).register(); }); });