-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
62 lines (55 loc) · 1.87 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const CACHE_NAME = "1.0.0";
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === "true",
});
const plugins = [withBundleAnalyzer];
const nextConfig = withBundleAnalyzer({
publicRuntimeConfig: {
CDN_URL: process.env.CDN_URL,
},
// generateInDevMode: true,
webpack: (config, {buildId, dev, isServer, defaultLoaders, webpack}) => {
config.module.rules.push({
test: /\.(png|jpg|gif)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 8192
}
}
]
});
// config.plugins.push(new webpack.IgnorePlugin({ resourceRegExp: /^pg-native$/ }))
return config;
},
// workboxOpts: {
// runtimeCaching: [{
// urlPattern: /\.(eot|woff|woff2|ttf|ttc|png|svg|jpg|jpeg|gif|cgm|tiff|webp|bmp|ico)$/i,
// handler: 'CacheFirst',
// options: {
// cacheName: CACHE_NAME + "-media",
// expiration: {
// maxAgeSeconds: 60 * 60 * 24 * 30, // 30 days
// },
// cacheableResponse: {
// statuses: [200],
// },
// },
// }, {
// urlPattern: /.*$/,
// handler: 'NetworkFirst',
// options: {
// cacheName: CACHE_NAME + "-pages",
// expiration: {
// maxAgeSeconds: 60 * 60 * 24 * 30, // 30 days
// },
// cacheableResponse: {
// statuses: [200],
// },
// },
// }]
// }
});
// export default plugins.reduce((acc, next) => next(acc), nextConfig)
module.exports = () => plugins.reduce((acc, next) => next(acc), nextConfig)