mirror of https://github.com/sgoudham/carbon.git
Add autoExport (#782)
* Add autoExport * Upgrade Next.js * Upgrade Next.js * export service worker to /public * fix service worker build - file exported to /public (unwanted) * next next@canary * try to fix SW * try to fix SW * add back _next routing for now * try a mix of configs * Fix service-worker serving * Remove _next route * Next 9 * move stuff back into /static * fix service-worker * don't use canary next builds * static/banner.png -> static/brand/banner.png * remove now-build scriptmain
parent
9460af2c4f
commit
7fdda47816
@ -1,3 +1,24 @@
|
||||
const withOffline = require('next-offline')
|
||||
|
||||
module.exports = withOffline({ dontAutoRegisterSw: true })
|
||||
module.exports = withOffline({
|
||||
target: 'serverless',
|
||||
dontAutoRegisterSw: true,
|
||||
workboxOpts: {
|
||||
// TODO get default config from `next-offline`?
|
||||
swDest: 'static/service-worker.js',
|
||||
globPatterns: ['static/**/*'],
|
||||
globDirectory: '.',
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /^https?.*/,
|
||||
handler: 'NetworkFirst',
|
||||
options: {
|
||||
cacheName: 'offlineCache',
|
||||
expiration: {
|
||||
maxEntries: 200
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Loading…
Reference in New Issue