Skip to content

Commit

Permalink
Reduce svg size & lzay load github.svg and grid.svg (yihong0618#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
vlin authored and 85Ryan committed Dec 23, 2023
1 parent b21aab3 commit aebe1fe
Show file tree
Hide file tree
Showing 23 changed files with 494 additions and 356 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:prettier/recommended',
],
overrides: [],
Expand Down
1 change: 1 addition & 0 deletions assets/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const yearStats = import.meta.glob('./year_*.svg', { import: 'ReactComponent' })
export const totalStat = import.meta.glob(['./github.svg', './grid.svg'], { import: 'ReactComponent' })
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"dependencies": {
"@mapbox/mapbox-gl-language": "^1.0.0",
"@mapbox/polyline": "^1.1.1",
"@svgr/plugin-svgo": "^8.1.0",
"@vercel/analytics": "^0.1.6",
"@vitejs/plugin-react": "^4.0.0",
"gcoord": "^0.3.2",
Expand Down
Loading

0 comments on commit aebe1fe

Please sign in to comment.