Skip to content

Commit 5aaa6ef

Browse files
committed
junk: Check build sizes for lazy loading widgets
1 parent fddf290 commit 5aaa6ef

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/components/widgets.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1+
import { lazy } from 'preact-iso';
2+
13
import Jumbotron from './jumbotron';
2-
import GithubRepos from './github-repos';
3-
import TodoList from './todo-list';
44
import Logo from './logo';
55
import Toc from './table-of-contents';
6-
import BlogOverview from './blog-overview';
76
import Sponsors from './sponsors';
8-
import WeAreUsing from './we-are-using';
9-
import Branding from './branding';
107
import TabGroup from './tab-group';
118

9+
// Hoist the CSS to avoid FOUC
10+
import './branding/style.module.css';
11+
import './blog-overview/style.module.css';
12+
import './we-are-using/style.module.css';
13+
14+
const Branding = lazy(() => import('./branding'));
15+
const BlogOverview = lazy(() => import('./blog-overview'));
16+
const GithubRepos = lazy(() => import('./github-repos'));
17+
const TodoList = lazy(() => import('./todo-list'));
18+
const WeAreUsing = lazy(() => import('./we-are-using'));
19+
1220
export default {
1321
Toc,
1422
BlogOverview,

0 commit comments

Comments
 (0)