/
githubmirror
/
tailwindcss
Обзор
Документация
Войти
/
githubmirror
/
tailwindcss
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/@tailwindcss-vite/src/index.test.ts
28 строк
945 B
Lazizbek Ergashev
Prevent `@tailwindcss/vite` crash under Vite's experimental `bundledDev` (#20379)
03 авг 2026, 16:10
Не верифицирован
03 авг 2026, 16:10
50daebd
Код
Авторство
О чём код?
import { expect, test } from 'vitest' import tailwindcss from './index' // Vite's experimental `bundledDev` mode calls `hotUpdate` without a `server`, // so the handler must not dereference it. // // - https://github.com/vitejs/vite/discussions/22746 // - https://github.com/tailwindlabs/tailwindcss/issues/20378 // - https://vite.dev/blog/announcing-vite8-1#experimental-bundled-dev-mode test('hotUpdate does not crash when Vite omits the server (bundledDev)', () => { let plugin = tailwindcss().find((plugin) => plugin.name === '@tailwindcss/vite:generate:serve')! let hotUpdate = plugin.hotUpdate as unknown as (options: { file: string modules: unknown[] timestamp: number server: undefined }) => unknown expect(() => hotUpdate.call(plugin, { file: '/app/template.html', modules: [{ type: 'asset', id: undefined }], timestamp: Date.now(), server: undefined, }), ).not.toThrow() })