Skip to content

Commit

Permalink
perf: 注释StrictMode严格模式
Browse files Browse the repository at this point in the history
  • Loading branch information
huangmingfu committed Nov 4, 2024
1 parent 940a4af commit 5948c45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

// 重置样式
Expand All @@ -9,7 +8,7 @@ import '@/styles/scss/global.scss';
import App from './app.tsx';

createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>
// <StrictMode>
<App />
// </StrictMode>
);
6 changes: 3 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
chunkSizeWarningLimit: 1500,
rollupOptions: {
output: {
chunkFileNames: 'js/[name]-[hash].js',
entryFileNames: 'js/[name]-[hash].js',
assetFileNames: '[ext]/[name]-[hash].[ext]',
chunkFileNames: 'js/[name]-[hash].js', // chunk包输出的文件夹名称
entryFileNames: 'js/[name]-[hash].js', // 入口文件输出的文件夹名称
assetFileNames: '[ext]/[name]-[hash].[ext]', // 静态文件输出的文件夹名称
manualChunks: {
'react-vendor': ['react', 'react-dom', 'react-router-dom']
// 'vendor':['antd']
Expand Down

0 comments on commit 5948c45

Please sign in to comment.