diff --git a/client/routes/PDP/index.js b/client/routes/PDP/index.js index bad7cab..cdbde74 100644 --- a/client/routes/PDP/index.js +++ b/client/routes/PDP/index.js @@ -1,14 +1,9 @@ -import React from 'react'; -import { object } from 'prop-types'; +import loadable from '@loadable/component'; -import PdpComponent from './components'; +const errorLoading = err => console.log('PDP page loading failed!', err); -const PDP = ({ match }) => { - return () -}; +const PDPComponent = loadable(() => + import(/* webpackChunkName: "pdp" */ './components').catch(errorLoading), +); -PDP.propTypes = { - match: object.isRequired, -}; - -export default PDP; +export default PDPComponent; diff --git a/tools/client/webpack.config.babel.js b/tools/client/webpack.config.babel.js index 19ca824..fd44473 100644 --- a/tools/client/webpack.config.babel.js +++ b/tools/client/webpack.config.babel.js @@ -406,6 +406,8 @@ module.exports = function() { color: '#61dafb', }), + new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), + new FriendlyErrorsWebpackPlugin(), // Generates an `index.html` or `index.client.html` file with the