feat: precache web assets. Closes #3030 (#3032)

This commit is contained in:
Gabe Kangas
2023-05-19 13:56:45 -07:00
committed by GitHub
parent def4c48fd8
commit ddef3f421c
3 changed files with 1092 additions and 318 deletions

View File

@ -2,8 +2,17 @@ const withLess = require('next-with-less');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const withPWA = require('next-pwa')({
dest: 'public',
register: true,
skipWaiting: true,
publicExcludes: ['!img/platformlogos/**/*', '!styles/admin/**/*'],
buildExcludes: [/chunks\/pages\/admin.*/, '!**/admin/**/*'],
sourcemap: process.env.NODE_ENV === 'development',
});
module.exports = withBundleAnalyzer(
module.exports = withPWA(
withBundleAnalyzer(
withLess({
productionBrowserSourceMaps: process.env.SOURCE_MAPS === 'true',
trailingSlash: true,
@ -51,4 +60,5 @@ module.exports = withBundleAnalyzer(
},
pageExtensions: ['tsx'],
}),
),
);

1302
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,9 @@
"linkifyjs": "^4.1.0",
"lodash": "4.17.21",
"next": "13.3.0",
"next-pwa": "^5.6.0",
"next-with-less": "2.0.5",
"next-with-workbox": "^3.0.5",
"picmo": "5.8.4",
"postcss-flexbugs-fixes": "5.0.2",
"prop-types": "15.8.1",
@ -56,6 +58,8 @@
"slate-react": "0.94.2",
"ua-parser-js": "1.0.35",
"video.js": "^8.3.0",
"workbox-precaching": "^6.5.4",
"workbox-window": "^6.5.4",
"xstate": "4.37.2",
"yaml": "2.2.2"
},