From 236c406f59f8ad2739570a7217f6ddc342023968 Mon Sep 17 00:00:00 2001 From: seunghee Date: Sun, 16 Feb 2025 19:48:42 +0900 Subject: [PATCH] fix: image hostname (#8) --- next.config.js | 66 ++++++++++---------------------------------------- 1 file changed, 13 insertions(+), 53 deletions(-) diff --git a/next.config.js b/next.config.js index 6e16809..0048b03 100644 --- a/next.config.js +++ b/next.config.js @@ -18,40 +18,19 @@ const ContentSecurityPolicy = ` const securityHeaders = [ // https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP - { - key: 'Content-Security-Policy', - value: ContentSecurityPolicy.replace(/\n/g, ''), - }, + { key: 'Content-Security-Policy', value: ContentSecurityPolicy.replace(/\n/g, '') }, // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy - { - key: 'Referrer-Policy', - value: 'strict-origin-when-cross-origin', - }, + { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' }, // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options - { - key: 'X-Frame-Options', - value: 'DENY', - }, + { key: 'X-Frame-Options', value: 'DENY' }, // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options - { - key: 'X-Content-Type-Options', - value: 'nosniff', - }, + { key: 'X-Content-Type-Options', value: 'nosniff' }, // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control - { - key: 'X-DNS-Prefetch-Control', - value: 'on', - }, + { key: 'X-DNS-Prefetch-Control', value: 'on' }, // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security - { - key: 'Strict-Transport-Security', - value: 'max-age=31536000; includeSubDomains', - }, + { key: 'Strict-Transport-Security', value: 'max-age=31536000; includeSubDomains' }, // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy - { - key: 'Permissions-Policy', - value: 'camera=(), microphone=(), geolocation=()', - }, + { key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' }, ] const isProd = process.env.NODE_ENV === 'production' @@ -70,39 +49,20 @@ module.exports = () => { basePath, reactStrictMode: true, pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], - eslint: { - dirs: ['app', 'components', 'layouts', 'scripts'], - }, + eslint: { dirs: ['app', 'components', 'layouts', 'scripts'] }, images: { remotePatterns: [ - { - protocol: 'https', - hostname: 'res.cloudinary.com', - }, - { - protocol: 'https', - hostname: 'sa02045.github.io', - }, - { - protocol: 'https', - hostname: 'github.com', - }, + { protocol: 'https', hostname: 'res.cloudinary.com' }, + { protocol: 'https', hostname: 'sa02045.github.io' }, + { protocol: 'https', hostname: 'github.io' }, ], }, async headers() { - return [ - { - source: '/(.*)', - headers: securityHeaders, - }, - ] + return [{ source: '/(.*)', headers: securityHeaders }] }, webpack: (config, options) => { - config.module.rules.push({ - test: /\.svg$/, - use: ['@svgr/webpack'], - }) + config.module.rules.push({ test: /\.svg$/, use: ['@svgr/webpack'] }) return config },