notea/next.config.js
2021-03-09 21:17:08 +08:00

37 lines
673 B
JavaScript

const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')
module.exports = withPWA({
rewrites() {
return [
{
source: '/',
destination: '/note/welcome',
},
]
},
redirects() {
return [
{
source: '/note',
destination: '/',
permanent: true,
},
]
},
webpack(config, { defaultLoaders }) {
config.module.rules.push({
test: /\.jsx/,
use: [defaultLoaders.babel],
include: [/node_modules\/heroicons/],
})
return config
},
pwa: {
disable: process.env.NODE_ENV === 'development',
dest: 'public',
runtimeCaching,
},
})