Skip to content

Commit

Permalink
chore, optimize: Reduce bundle size
Browse files Browse the repository at this point in the history
- Remove unused dependency (numeral)
- Only user partial bundle for plotly
- Add source-map-explorer for analysis
  • Loading branch information
mithi committed Jun 17, 2020
1 parent 725689d commit 2bd87b5
Show file tree
Hide file tree
Showing 4 changed files with 1,347 additions and 4,032 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"mathjs": "^7.0.0",
"numeral": "^2.0.6",
"plotly.js": "^1.54.1",
"plotly.js-gl3d-dist-min": "^1.54.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-icons": "^3.10.0",
"react-markdown": "^4.3.1",
"react-plotly.js": "^2.4.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1"
"react-scripts": "3.4.1",
"source-map-explorer": "^2.4.2"
},
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
Expand Down
4 changes: 3 additions & 1 deletion src/components/HexapodPlot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from "react"
import Plot from "react-plotly.js"
import Plotly from "plotly.js-gl3d-dist-min"
import createPlotlyComponent from "react-plotly.js/factory"
const Plot = createPlotlyComponent(Plotly)

const HexapodPlot = props => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ h3 {
margin-bottom: 5px;
margin-left: 5px;
font-weight: bold;
font-size: 2.0rem;
font-size: 2rem;
}

h2 {
Expand Down

0 comments on commit 2bd87b5

Please sign in to comment.