perf(web): remove legacy theme from production bundle
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user