notea/next.config.js
2021-04-26 09:59:40 +08:00

27 lines
522 B
JavaScript

const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')
module.exports = withPWA({
future: {
webpack5: true,
},
target: process.env.NETLIFY ? 'serverless' : 'server',
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,
},
})