Skip to content

Commit 68736d4

Browse files
authored
Merge pull request #6 from gogglesgogs:code-split
redo code splitting
2 parents 80849c2 + bdf3f84 commit 68736d4

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "tsc -b && vite build --profile",
8+
"build": "tsc -b && vite build",
99
"format": "prettier . --write",
1010
"preview": "vite preview"
1111
},

src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { StrictMode, lazy } from 'react';
22
import { createRoot } from 'react-dom/client';
33
import { BrowserRouter } from 'react-router-dom';
4+
import App from './App.tsx';
45
import './index.css';
56

6-
const App = lazy(() => import('./App.tsx'));
77
const Nav = lazy(() => import('./components/Nav.tsx'));
88
const Footer = lazy(() => import('./components/Footer.tsx'));
99

vite.config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ export default defineConfig({
88
rollupOptions: {
99
output: {
1010
manualChunks: {
11-
react: ['react', 'react-dom', 'react-router-dom'],
12-
tailwind: ['tailwind-merge', 'clsx'],
11+
react: ['react', 'react-dom'],
12+
libs: [
13+
'react-router-dom',
14+
'/src/utils/cn.ts',
15+
'tailwind-merge',
16+
'clsx',
17+
],
1318
animation: ['framer-motion'],
1419
},
1520
compact: true,

0 commit comments

Comments
 (0)