Skip to content

Commit 078b0a1

Browse files
committed
removing p5 from import to rely on CDN
1 parent 90860bc commit 078b0a1

File tree

5 files changed

+254
-9
lines changed

5 files changed

+254
-9
lines changed

gatsby-config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module.exports = {
1212
siteUrl: `https://processing.org/`
1313
},
1414
plugins: [
15+
`gatsby-plugin-perf-budgets`,
16+
`gatsby-plugin-webpack-bundle-analyser-v2`,
1517
`gatsby-plugin-react-helmet`,
1618
{
1719
resolve: `gatsby-theme-i18n`,

gatsby-ssr.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
Disable inline CSS. This brings the size of the reference from 100MB to 30MB,
3+
just by removing inline CSS which already exists in stand-alone CSS files and
4+
is only used to speed up initial rendering.
5+
**/
6+
export const onPreRenderHTML = ({ getHeadComponents }) => {
7+
if (process.env.NODE_ENV !== 'production') {
8+
return;
9+
}
10+
getHeadComponents().forEach((el) => {
11+
if (el.type === 'style' && el.props['data-href']) {
12+
el.type = 'link';
13+
el.props['href'] = el.props['data-href'];
14+
el.props['rel'] = 'stylesheet';
15+
el.props['type'] = 'text/css';
16+
delete el.props['data-href'];
17+
delete el.props['dangerouslySetInnerHTML'];
18+
}
19+
});
20+
};

package-lock.json

Lines changed: 226 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"highlight.js": "^11.2.0",
6464
"lodash": "4.17.21",
6565
"luxon": "^1.27.0",
66-
"p5": "^1.4.0",
6766
"postcss": "^8.3.5",
6867
"postcss-calc": "^8.0.0",
6968
"postcss-custom-media": "^8.0.0",
@@ -85,6 +84,8 @@
8584
"@designsystemsinternational/static": "^3.3.12",
8685
"fast-glob": "^3.2.7",
8786
"fs-extra": "^10.0.0",
87+
"gatsby-plugin-perf-budgets": "0.0.18",
88+
"gatsby-plugin-webpack-bundle-analyser-v2": "^1.1.25",
8889
"inquirer": "^8.1.2",
8990
"prettier": "2.0.5"
9091
},

0 commit comments

Comments
 (0)