Skip to content
This repository has been archived by the owner on Aug 30, 2020. It is now read-only.

Commit

Permalink
feat: add pdp chunk & optimize moment plugin
Browse files Browse the repository at this point in the history
add lazy image

add lazy

add image ratio

fix: unused changes

fix: remove unused 3rd party
  • Loading branch information
josteph authored and irfan-maulana-tkp committed Aug 10, 2020
1 parent 4157021 commit f64fe68
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
17 changes: 6 additions & 11 deletions client/routes/PDP/index.js
Original file line number Diff line number Diff line change
@@ -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 (<PdpComponent match={match}/>)
};
const PDPComponent = loadable(() =>
import(/* webpackChunkName: "pdp" */ './components').catch(errorLoading),
);

PDP.propTypes = {
match: object.isRequired,
};

export default PDP;
export default PDPComponent;
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"unfetch": "^4.1.0",
"url-loader": "1.1.2",
"url-polyfill": "^1.1.7",
"vanilla-lazyload": "11.0.6",
"webpack": "4.29.6",
"webpack-dev-server": "3.8.0",
"webpack-manifest-plugin": "2.0.4",
Expand Down
2 changes: 2 additions & 0 deletions tools/client/webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <script> injected.
new HtmlWebpackPlugin(
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11877,11 +11877,6 @@ value-equal@^0.4.0:
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7"
integrity sha512-x+cYdNnaA3CxvMaTX0INdTCN8m8aF2uY9BvEqmxuYp8bL09cs/kWVQPVGcA35fMktdOsP69IgU7wFj/61dJHEw==

[email protected]:
version "11.0.6"
resolved "https://registry.yarnpkg.com/vanilla-lazyload/-/vanilla-lazyload-11.0.6.tgz#76a13ece6c256d5f6451bc0687038c485441ca11"
integrity sha512-mEOSXyF0W/9mGuqTWFIEaqiVqPD10EBTur0tRKmPC0Z/a0r4LWB6c/4D24nmhGtnEDiDGtK2rUIyl8P3PJhUOw==

vary@^1.1.2, vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
Expand Down

0 comments on commit f64fe68

Please sign in to comment.