This repository was archived by the owner on Aug 30, 2020. It is now read-only.
File tree 4 files changed +8
-17
lines changed
4 files changed +8
-17
lines changed Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
- import { object } from 'prop-types' ;
1
+ import loadable from '@loadable/component' ;
3
2
4
- import PdpComponent from './components' ;
3
+ const errorLoading = err => console . log ( 'PDP page loading failed!' , err ) ;
5
4
6
- const PDP = ( { match } ) => {
7
- return ( < PdpComponent match = { match } /> )
8
- } ;
5
+ const PDPComponent = loadable ( ( ) =>
6
+ import ( /* webpackChunkName: "pdp" */ './components' ) . catch ( errorLoading ) ,
7
+ ) ;
9
8
10
- PDP . propTypes = {
11
- match : object . isRequired ,
12
- } ;
13
-
14
- export default PDP ;
9
+ export default PDPComponent ;
Original file line number Diff line number Diff line change 86
86
"unfetch" : " ^4.1.0" ,
87
87
"url-loader" : " 1.1.2" ,
88
88
"url-polyfill" : " ^1.1.7" ,
89
- "vanilla-lazyload" : " 11.0.6" ,
90
89
"webpack" : " 4.29.6" ,
91
90
"webpack-dev-server" : " 3.8.0" ,
92
91
"webpack-manifest-plugin" : " 2.0.4" ,
Original file line number Diff line number Diff line change @@ -406,6 +406,8 @@ module.exports = function() {
406
406
color : '#61dafb' ,
407
407
} ) ,
408
408
409
+ new webpack . IgnorePlugin ( / ^ \. \/ l o c a l e $ / , / m o m e n t $ / ) ,
410
+
409
411
new FriendlyErrorsWebpackPlugin ( ) ,
410
412
// Generates an `index.html` or `index.client.html` file with the <script> injected.
411
413
new HtmlWebpackPlugin (
Original file line number Diff line number Diff line change @@ -11877,11 +11877,6 @@ value-equal@^0.4.0:
11877
11877
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7"
11878
11878
integrity sha512-x+cYdNnaA3CxvMaTX0INdTCN8m8aF2uY9BvEqmxuYp8bL09cs/kWVQPVGcA35fMktdOsP69IgU7wFj/61dJHEw==
11879
11879
11880
-
11881
- version "11.0.6"
11882
- resolved "https://registry.yarnpkg.com/vanilla-lazyload/-/vanilla-lazyload-11.0.6.tgz#76a13ece6c256d5f6451bc0687038c485441ca11"
11883
- integrity sha512-mEOSXyF0W/9mGuqTWFIEaqiVqPD10EBTur0tRKmPC0Z/a0r4LWB6c/4D24nmhGtnEDiDGtK2rUIyl8P3PJhUOw==
11884
-
11885
11880
vary@^1.1.2, vary@~1.1.2:
11886
11881
version "1.1.2"
11887
11882
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
You can’t perform that action at this time.
0 commit comments