Skip to content

Commit 6290ea5

Browse files
farnabazatinux
andauthored
fix: prevent unwanted reloads on content change (#539)
Co-authored-by: Sébastien Chopin <[email protected]>
1 parent e17a1bf commit 6290ea5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/hmr.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export default function (tailwindConfig: any = {}, rootDir: string, cssPath: str
3535
}
3636
})
3737
})
38+
if (ctx.file.includes('/content-cache/')) {
39+
// @ts-ignore
40+
return true
41+
}
3842
}
3943
}
4044
};

src/module.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,6 @@ export default defineNuxtModule<ModuleOptions>({
204204
postcssOptions.plugins = postcssOptions.plugins || {}
205205
postcssOptions.plugins['tailwindcss/nesting'] = postcssOptions.plugins['tailwindcss/nesting'] ?? {}
206206
postcssOptions.plugins['postcss-custom-properties'] = postcssOptions.plugins['postcss-custom-properties'] ?? {}
207-
// Hot fix for Tailwind refreshing in dev when changing markdown files in content
208-
if (nuxt.options.dev && tailwindConfig.content) {
209-
tailwindConfig.content = tailwindConfig.content.filter((path: string) => !path.includes('/content-cache/parsed'))
210-
}
211207
postcssOptions.plugins.tailwindcss = tailwindConfig
212208

213209
if (isNuxt2()) {

0 commit comments

Comments
 (0)