mirror of
https://github.com/owncast/owncast.git
synced 2025-01-28 19:13:46 +03:00
fix: fix runtime caching error and adjust rules (#3970)
* fix: fix runtime caching error and adjust rules * fix: add cache config for ts and m3u8 * revert ts and m3u8 cache config to previous behaviour * remove unused runtime caching config * remove all runtime caching config --------- Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
parent
99acc19cee
commit
6399df7f9e
1 changed files with 12 additions and 20 deletions
|
@ -3,28 +3,10 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
|||
enabled: process.env.ANALYZE === 'true',
|
||||
});
|
||||
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants');
|
||||
const runtimeCaching = require('next-pwa/cache');
|
||||
|
||||
const withPWA = require('next-pwa')({
|
||||
dest: 'public',
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /\.(?:ts|m3u8)$/i,
|
||||
handler: 'NetworkOnly',
|
||||
},
|
||||
{
|
||||
urlPattern: (url) => { return url.pathname.startsWith("/admin/"); },
|
||||
handler: 'NetworkOnly',
|
||||
options: {
|
||||
fetchOptions: { credentials: 'same-origin' }
|
||||
}
|
||||
},
|
||||
{
|
||||
urlPattern: (url) => { return url.pathname.startsWith("/api/"); },
|
||||
handler: 'NetworkOnly',
|
||||
},
|
||||
...runtimeCaching,
|
||||
],
|
||||
runtimeCaching: [],
|
||||
register: true,
|
||||
skipWaiting: true,
|
||||
disableDevLogs: true,
|
||||
|
@ -77,7 +59,17 @@ module.exports = async phase => {
|
|||
unoptimized: true,
|
||||
},
|
||||
swcMinify: true,
|
||||
transpilePackages: [ "antd", "@ant-design", "rc-util", "rc-pagination", "rc-picker", "rc-notification", "rc-tooltip", "rc-tree", "rc-table" ],
|
||||
transpilePackages: [
|
||||
'antd',
|
||||
'@ant-design',
|
||||
'rc-util',
|
||||
'rc-pagination',
|
||||
'rc-picker',
|
||||
'rc-notification',
|
||||
'rc-tooltip',
|
||||
'rc-tree',
|
||||
'rc-table',
|
||||
],
|
||||
webpack(config) {
|
||||
config.module.rules.push({
|
||||
test: /\.svg$/i,
|
||||
|
|
Loading…
Add table
Reference in a new issue