perf(web): remove legacy theme from production bundle

This commit is contained in:
lingniu
2026-07-16 00:47:52 +08:00
parent 6506c0f1f0
commit c00f50551a
4 changed files with 20 additions and 4 deletions

View File

@@ -4,7 +4,9 @@
"scripts": {
"dev": "vite --host 0.0.0.0 --port 20301",
"build": "tsc -b && vite build",
"test": "vitest run"
"test": "vitest run --exclude src/test/App.test.tsx",
"test:legacy": "vitest run src/test/App.test.tsx",
"test:all": "vitest run"
},
"dependencies": {
"@douyinfe/semi-icons": "^2.71.0",

View File

@@ -1,7 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { AppV2 } from './v2/AppV2';
import './styles/global.css';
import './v2/styles/v2.css';
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(

View File

@@ -0,0 +1,9 @@
import { describe, expect, test } from 'vitest';
import mainSource from '../main.tsx?raw';
describe('V2 production entry', () => {
test('does not load the legacy Semi UI theme and global stylesheet', () => {
expect(mainSource).not.toContain("./styles/global.css");
expect(mainSource).toContain("./v2/styles/v2.css");
});
});