Skip to content

Commit 1734058

Browse files
committedFeb 20, 2023
fix: don't add tailwind viewer in devtools if disabled
1 parent 2bdbaaa commit 1734058

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎playground/nuxt.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default defineNuxtConfig({
66
'@nuxt/devtools'
77
],
88
tailwindcss: {
9+
viewer: false,
910
exposeConfig: true,
1011
injectPosition: 'last'
1112
},

‎src/module.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
} from '@nuxt/kit'
1919
import { Config } from 'tailwindcss'
2020
import { eventHandler, sendRedirect } from 'h3'
21+
import { optionalCallExpression } from '@babel/types'
2122
import { name, version } from '../package.json'
2223
import vitePlugin from './hmr'
2324
import defaultTailwindConfig from './tailwind.config'
@@ -320,7 +321,7 @@ export default defineNuxtModule<ModuleOptions>({
320321
})
321322
}
322323

323-
if (nuxt.options.dev) {
324+
if (nuxt.options.dev && moduleOptions.viewer) {
324325
// @ts-expect-error missing type
325326
nuxt.hook('devtools:customTabs', (tabs) => {
326327
tabs.push({

0 commit comments

Comments
 (0)
Please sign in to comment.