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

Commit f64fe68

Browse files
jostephirfan-maulana-tkp
authored andcommitted
feat: add pdp chunk & optimize moment plugin
add lazy image add lazy add image ratio fix: unused changes fix: remove unused 3rd party
1 parent 4157021 commit f64fe68

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

Diff for: client/routes/PDP/index.js

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
import React from 'react';
2-
import { object } from 'prop-types';
1+
import loadable from '@loadable/component';
32

4-
import PdpComponent from './components';
3+
const errorLoading = err => console.log('PDP page loading failed!', err);
54

6-
const PDP = ({ match }) => {
7-
return (<PdpComponent match={match}/>)
8-
};
5+
const PDPComponent = loadable(() =>
6+
import(/* webpackChunkName: "pdp" */ './components').catch(errorLoading),
7+
);
98

10-
PDP.propTypes = {
11-
match: object.isRequired,
12-
};
13-
14-
export default PDP;
9+
export default PDPComponent;

Diff for: package.json

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
"unfetch": "^4.1.0",
8787
"url-loader": "1.1.2",
8888
"url-polyfill": "^1.1.7",
89-
"vanilla-lazyload": "11.0.6",
9089
"webpack": "4.29.6",
9190
"webpack-dev-server": "3.8.0",
9291
"webpack-manifest-plugin": "2.0.4",

Diff for: tools/client/webpack.config.babel.js

+2
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ module.exports = function() {
406406
color: '#61dafb',
407407
}),
408408

409+
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
410+
409411
new FriendlyErrorsWebpackPlugin(),
410412
// Generates an `index.html` or `index.client.html` file with the <script> injected.
411413
new HtmlWebpackPlugin(

Diff for: yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -11877,11 +11877,6 @@ value-equal@^0.4.0:
1187711877
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7"
1187811878
integrity sha512-x+cYdNnaA3CxvMaTX0INdTCN8m8aF2uY9BvEqmxuYp8bL09cs/kWVQPVGcA35fMktdOsP69IgU7wFj/61dJHEw==
1187911879

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-
1188511880
vary@^1.1.2, vary@~1.1.2:
1188611881
version "1.1.2"
1188711882
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"

0 commit comments

Comments
 (0)