Nuxt/test/fixtures/basic/plugins/dependsOnPlugin.ts

13 lines
322 B
TypeScript
Raw Normal View History

export default defineNuxtPlugin({
name: 'depends-on-plugin',
dependsOn: ['async-plugin'],
async setup () {
const nuxtApp = useNuxtApp()
if (!nuxtApp.$asyncPlugin) {
throw new Error('$asyncPlugin is not defined')
}
await new Promise(resolve => setTimeout(resolve, 100))
},
parallel: true
})