From 6290ea58123df76eae75e7304b7c0c95300a43b7 Mon Sep 17 00:00:00 2001 From: Farnabaz Date: Fri, 7 Oct 2022 22:38:07 +0200 Subject: [PATCH] fix: prevent unwanted reloads on content change (#539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Chopin --- src/hmr.ts | 4 ++++ src/module.ts | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hmr.ts b/src/hmr.ts index 25d3c990..55c35232 100644 --- a/src/hmr.ts +++ b/src/hmr.ts @@ -35,6 +35,10 @@ export default function (tailwindConfig: any = {}, rootDir: string, cssPath: str } }) }) + if (ctx.file.includes('/content-cache/')) { + // @ts-ignore + return true + } } } }; diff --git a/src/module.ts b/src/module.ts index 6c3b1117..7951a43f 100644 --- a/src/module.ts +++ b/src/module.ts @@ -204,10 +204,6 @@ export default defineNuxtModule({ postcssOptions.plugins = postcssOptions.plugins || {} postcssOptions.plugins['tailwindcss/nesting'] = postcssOptions.plugins['tailwindcss/nesting'] ?? {} postcssOptions.plugins['postcss-custom-properties'] = postcssOptions.plugins['postcss-custom-properties'] ?? {} - // Hot fix for Tailwind refreshing in dev when changing markdown files in content - if (nuxt.options.dev && tailwindConfig.content) { - tailwindConfig.content = tailwindConfig.content.filter((path: string) => !path.includes('/content-cache/parsed')) - } postcssOptions.plugins.tailwindcss = tailwindConfig if (isNuxt2()) {