Skip to content

Commit

Permalink
fix: prevent unwanted reloads on content change (#539)
Browse files Browse the repository at this point in the history
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
  • Loading branch information
farnabaz and Atinux committed Oct 7, 2022
1 parent e17a1bf commit 6290ea5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/hmr.ts
Expand Up @@ -35,6 +35,10 @@ export default function (tailwindConfig: any = {}, rootDir: string, cssPath: str
}
})
})
if (ctx.file.includes('/content-cache/')) {
// @ts-ignore
return true
}
}
}
};
4 changes: 0 additions & 4 deletions src/module.ts
Expand Up @@ -204,10 +204,6 @@ export default defineNuxtModule<ModuleOptions>({
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()) {
Expand Down

0 comments on commit 6290ea5

Please sign in to comment.