You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
carbon/next.config.js

30 lines
746 B
JavaScript

const bundleAnalyzer = require('@next/bundle-analyzer')
const withOffline = require('next-offline')
const withBundleAnalyzer = bundleAnalyzer({ enabled: true })
const config = 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
}
}
}
]
}
})
module.exports = process.env.ANALYZE === 'true' ? withBundleAnalyzer(config) : config