Skip to content

Instantly share code, notes, and snippets.

@mohammed-io
mohammed-io / tailwind-jit-patch-plugin.ts
Created December 10, 2021 14:35
A patch to make the Vite HMR work with Tailwind JIT
import { utimes } from 'fs/promises'
import { debounce } from 'lodash'
import path from 'path'
import { ViteDevServer } from 'vite'
const touchFile = async path => {
const time = new Date()
return utimes(path, time, time)
}