File tree 5 files changed +39
-3
lines changed
5 files changed +39
-3
lines changed Original file line number Diff line number Diff line change 64
64
"settle-promise" : " 1.0.0" ,
65
65
"source-map" : " 0.5.6" ,
66
66
"terser-webpack-plugin" : " 1.2.3" ,
67
- "webpack" : " ^4.29.6 "
67
+ "webpack" : " ^4.35.0 "
68
68
},
69
69
"jest" : {
70
70
"setupFiles" : [
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ class App extends Component {
68
68
// This works around an issue of a duplicate hash in the href
69
69
// Ex: http://localhost:3001/#array-destructuring#array-destructuring
70
70
// This seems like a jsdom bug as the URL in initDom.js appears to be correct
71
- const feature = url . slice ( url . lastIndexOf ( "#" ) + 1 ) ;
71
+ const feature = url . slice ( url . lastIndexOf ( '#' ) + 1 ) ;
72
72
73
73
switch ( feature ) {
74
74
case 'array-destructuring' :
@@ -241,6 +241,11 @@ class App extends Component {
241
241
this . setFeature ( f . default )
242
242
) ;
243
243
break ;
244
+ case 'dynamic-import' :
245
+ import ( './features/webpack/DynamicImport' ) . then ( f =>
246
+ this . setFeature ( f . default )
247
+ ) ;
248
+ break ;
244
249
default :
245
250
this . setState ( { error : `Missing feature "${ feature } "` } ) ;
246
251
}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import React from 'react' ;
9
+
10
+ export default ( ) => {
11
+ return < > Hello World!</ > ;
12
+ } ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import React from 'react' ;
9
+ import ReactDOM from 'react-dom' ;
10
+
11
+ describe ( 'dynamic import' , ( ) => {
12
+ it ( 'renders without crashing' , async ( ) => {
13
+ import ( './DynamicImport' ) . then ( DynamicImport => {
14
+ const div = document . createElement ( 'div' ) ;
15
+ ReactDOM . render ( < DynamicImport /> , div ) ;
16
+ expect ( div . textContent ) . toBe ( 'Hello World!' ) ;
17
+ } ) ;
18
+ } ) ;
19
+ } ) ;
Original file line number Diff line number Diff line change 76
76
"terser-webpack-plugin" : " 1.2.3" ,
77
77
"ts-pnp" : " 1.1.2" ,
78
78
"url-loader" : " 1.1.2" ,
79
- "webpack" : " 4.29.6 " ,
79
+ "webpack" : " 4.35.0 " ,
80
80
"webpack-dev-server" : " 3.2.1" ,
81
81
"webpack-manifest-plugin" : " 2.0.4" ,
82
82
"workbox-webpack-plugin" : " 4.2.0"
You can’t perform that action at this time.
0 commit comments