Skip to content

Commit

Permalink
feat(nuxt): devtools integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 6, 2023
1 parent cb0ec30 commit 2b8cc62
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/nuxt/src/index.ts
Expand Up @@ -78,6 +78,21 @@ export default defineNuxtModule<UnocssNuxtOptions>({
config.plugins.unshift(...VitePlugin({}, unoConfig))
})

if (nuxt.options.dev) {
// @ts-expect-error missing type
nuxt.hook('devtools:customTabs', (tabs) => {
tabs.push({
title: 'UnoCSS',
name: 'unocss',
icon: 'logos-unocss',
view: {
type: 'iframe',
src: '/__unocss/',
},
})
})
}

// Nuxt 2
if (isNuxt2()) {
nuxt.hook('app:resolve', (config) => {
Expand Down

0 comments on commit 2b8cc62

Please sign in to comment.