60 lines
1.3 KiB
JavaScript
60 lines
1.3 KiB
JavaScript
import createNextIntlPlugin from 'next-intl/plugin';
|
|
|
|
const withNextIntl = createNextIntlPlugin();
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
output: 'export',
|
|
distDir: 'dist',
|
|
reactStrictMode: false,
|
|
future: { webpack: true },
|
|
|
|
// trailingSlash: true,
|
|
webpack: (config, { isServer }) => {
|
|
if (!isServer) {
|
|
config.resolve.fallback = {
|
|
fs: false,
|
|
path: false,
|
|
};
|
|
}
|
|
|
|
const fileLoaderRule = config.module.rules.find((rule) =>
|
|
rule.test?.test?.('.svg')
|
|
);
|
|
|
|
config.module.rules.push(
|
|
// Reapply the existing rule, but only for svg imports ending in ?url
|
|
{
|
|
...fileLoaderRule,
|
|
test: /\.svg$/i,
|
|
resourceQuery: /url/, // *.svg?url
|
|
},
|
|
// Convert all other *.svg imports to React components
|
|
{
|
|
test: /\.svg$/i,
|
|
issuer: fileLoaderRule.issuer,
|
|
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
|
|
use: ['@svgr/webpack'],
|
|
}
|
|
);
|
|
|
|
return config;
|
|
},
|
|
images: {
|
|
remotePatterns: [
|
|
{
|
|
protocol: 'https',
|
|
hostname: 'graff.estate',
|
|
port: '',
|
|
},
|
|
{
|
|
protocol: 'https',
|
|
hostname: 'storage.yandexcloud.net',
|
|
port: '',
|
|
},
|
|
],
|
|
},
|
|
};
|
|
|
|
export default withNextIntl(nextConfig);
|