import type { NextConfig } from 'next' import path from 'path' const nextConfig: NextConfig = { /* config options here */ sassOptions: { includePaths: [path.join(__dirname, './src/styles')], }, serverExternalPackages: ['@react-pdf/renderer', 'pino'], logging: { fetches: { fullUrl: true, }, }, allowedDevOrigins: ['hanasysfield.jp', '*.hanasysfield.jp'], async rewrites() { return [ { source: '/api/user/login', destination: `${process.env.NEXT_PUBLIC_QSP_API_URL}/api/user/login`, }, // { // source: '/api/:path*', // destination: `${process.env.NEXT_PUBLIC_API_URL}/api/:path*`, // }, ] }, webpack: (config, { dev, isServer }) => { if (!dev && !isServer) { config.optimization.minimizer = config.optimization.minimizer || [] config.optimization.minimizer.push( new (require('terser-webpack-plugin'))({ terserOptions: { format: { comments: false, }, }, extractComments: false, }), ) } return config }, } export default nextConfig