From 3017f4bf9f8c6ed951ca452fc9b2e1799dc8d4f7 Mon Sep 17 00:00:00 2001 From: DamianGlowala Date: Thu, 27 Oct 2022 19:12:18 +0200 Subject: [PATCH 1/2] fix: normalise undefined `nuxt.options.watch` --- src/module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index 21221a20..54448f5d 100644 --- a/src/module.ts +++ b/src/module.ts @@ -109,6 +109,7 @@ export default defineNuxtModule({ // Watch the Tailwind config file to restart the server if (nuxt.options.dev) { + nuxt.options.watch = nuxt.options.watch ?? [] configPaths.forEach(path => nuxt.options.watch.push(path)) } @@ -143,7 +144,7 @@ export default defineNuxtModule({ getContents: () => `module.exports = ${JSON.stringify(resolvedConfig, null, 2)}`, write: true }) - + // Expose resolved tailwind config as an alias // https://tailwindcss.com/docs/configuration/#referencing-in-javascript if (moduleOptions.exposeConfig) { From a8dd9d3a2f81b8bb07d20f2979a03baab6f8c158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20G=C5=82owala?= <48835293+DamianGlowala@users.noreply.github.com> Date: Thu, 27 Oct 2022 20:58:29 +0200 Subject: [PATCH 2/2] Update operator --- src/module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index 54448f5d..6d274c03 100644 --- a/src/module.ts +++ b/src/module.ts @@ -109,7 +109,7 @@ export default defineNuxtModule({ // Watch the Tailwind config file to restart the server if (nuxt.options.dev) { - nuxt.options.watch = nuxt.options.watch ?? [] + nuxt.options.watch = nuxt.options.watch || [] configPaths.forEach(path => nuxt.options.watch.push(path)) }