修复退役样式开发态加载
将退役 CSS 源码过滤调整到 Tailwind 转换前执行 新增 Vite 插件顺序回归测试 补充退役方案与开发态白屏排障记录
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import type { Plugin } from 'vite';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import viteConfig from '../vite.config';
|
||||
|
||||
async function resolveRetiredCssPlugin() {
|
||||
const resolvedConfig =
|
||||
typeof viteConfig === 'function'
|
||||
? await viteConfig({ command: 'serve', mode: 'test' })
|
||||
: viteConfig;
|
||||
const plugins = (resolvedConfig.plugins ?? []).flat(Infinity) as Plugin[];
|
||||
return plugins.find(
|
||||
(plugin) => plugin?.name === 'retired-creation-template-css',
|
||||
);
|
||||
}
|
||||
|
||||
describe('retired creation template CSS plugin', () => {
|
||||
it('runs before Tailwind turns source CSS into a Vite JavaScript module', async () => {
|
||||
const plugin = await resolveRetiredCssPlugin();
|
||||
|
||||
expect(plugin).toBeDefined();
|
||||
expect(plugin?.enforce).toBe('pre');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user