Skip to content

Commit 5b373c6

Browse files
fix: normalise undefined nuxt.options.watch (#553)
1 parent 3f835bd commit 5b373c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export default defineNuxtModule<ModuleOptions>({
109109

110110
// Watch the Tailwind config file to restart the server
111111
if (nuxt.options.dev) {
112+
nuxt.options.watch = nuxt.options.watch || []
112113
configPaths.forEach(path => nuxt.options.watch.push(path))
113114
}
114115

@@ -143,7 +144,7 @@ export default defineNuxtModule<ModuleOptions>({
143144
getContents: () => `module.exports = ${JSON.stringify(resolvedConfig, null, 2)}`,
144145
write: true
145146
})
146-
147+
147148
// Expose resolved tailwind config as an alias
148149
// https://tailwindcss.com/docs/configuration/#referencing-in-javascript
149150
if (moduleOptions.exposeConfig) {

0 commit comments

Comments
 (0)