File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 44 "main" : " build/index.html" ,
55 "unpkg" : " build/index.html" ,
66 "dependencies" : {
7+ "@loadable/component" : " ^5.12.0" ,
78 "antd" : " ^3.26.12" ,
89 "axios" : " ^0.19.0" ,
910 "codemirror" : " ^5.52.2" ,
2425 "devDependencies" : {
2526 "@types/babel__standalone" : " ^7.1.2" ,
2627 "@types/jest" : " 24.0.15" ,
28+ "@types/loadable__component" : " ^5.10.0" ,
2729 "@types/lodash" : " ^4.14.149" ,
2830 "@types/node" : " 12.0.10" ,
2931 "@types/react" : " 16.8.22" ,
Original file line number Diff line number Diff line change 1+ import loadable from '@loadable/component' ;
12import React from 'react' ;
23import {
34 HashRouter as Router ,
5+ Redirect ,
46 Route ,
57 Switch ,
6- Redirect ,
78} from 'react-router-dom' ;
8- import { Gallery } from './gallery' ;
9- import { Playground } from './playground' ;
9+
10+ // react-router code-splitting
11+ // https://reacttraining.com/react-router/web/guides/code-splitting
12+ let Gallery = loadable ( async ( ) => {
13+ return ( await import ( './gallery' ) ) . Gallery ;
14+ } ) ;
15+ let Playground = loadable ( async ( ) => {
16+ return ( await import ( './playground' ) ) . Playground ;
17+ } ) ;
1018
1119function AppRouter ( ) {
1220 return (
You can’t perform that action at this time.
0 commit comments