-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
44 lines (38 loc) · 1.12 KB
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: false,
images: {
domains: ['sid86-dashboard.s3-ap-south-1.amazonaws.com'],
},
webpack: (config) => {
config.resolve.fallback = { fs: false };
return config;
},
compiler: {
removeConsole: process.env.NODE_ENV === 'production',
},
};
const express = require('express');
const server = express();
server.use(express.static(__dirname + '/public', { maxAge: '365d' }));
server.use(function (req, res, next) {
if (req.url.match('.js|.css|.woff|.jpg|.png|.gif|.ttf')) {
res.setHeader('Cache-Control', 'public,max-age=31536000'); // 365 days
}
next();
});
const withPWA = require('next-pwa')({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
register: true,
scope: '/',
// sw: 'service-worker.js',
skipWaiting: true,
});
// const withBundleAnalyzer = require('@next/bundle-analyzer')({
// enabled: process.env.ANALYZE === 'true',
// openAnalyzer: process.env.NODE_ENV === 'development' && false,
// });
// module.exports = withBundleAnalyzer(withPWA(nextConfig));
module.exports = withPWA(nextConfig);