-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
70 lines (68 loc) · 2 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
63
64
65
66
67
68
69
70
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
nextScriptWorkers: true,
},
typescript: {
ignoreBuildErrors: true,
},
images: {
formats: ["image/webp", "image/avif"],
remotePatterns: [
{
protocol: "https",
hostname: "s3.amazonaws.com",
port: "",
pathname: "/my-bucket/**",
},
],
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
domains: [
"jeontongju-dev-bucket2.s3.ap-northeast-2.amazonaws.com",
"lh3.googleusercontent.com",
],
path: "/_next/image",
// loader can be 'default', 'imgix', 'cloudinary', 'akamai', or 'custom'
loader: "default",
loaderFile: "",
disableStaticImages: false,
minimumCacheTTL: 60,
// enable dangerous use of SVG images
dangerouslyAllowSVG: false,
// set the Content-Security-Policy header
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
// sets the Content-Disposition header (inline or attachment)
contentDispositionType: "inline",
// limit of 50 objects
// when true, every image will be unoptimized
unoptimized: false,
minimumCacheTTL: 60,
},
webpack: (config, options) => {
config.module.rules.push({
test: /\.(mp3)$/,
use: {
loader: "file-loader",
options: {
name: "[name].[ext]",
publicPath: `/_next/static/sounds/`,
outputPath: `${options.isServer ? "../" : ""}static/sounds/`,
},
},
});
return config;
},
};
const runtimeCaching = require("next-pwa/cache");
const prod = process.env.NODE_ENV === "production";
const withPWA = require("next-pwa")({
dest: "public",
register: true,
disable: prod ? false : true,
skipWaiting: true,
});
const withImages = require("next-images");
const withVideos = require("next-videos");
module.exports = withPWA(withVideos(nextConfig));
// module.exports = withPWA(withVideos(withImages(nextConfig)));