33 lines
831 B
JavaScript
33 lines
831 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
const envSchema = require('./config/schema/env');
|
|
|
|
const env = envSchema.parse(process.env);
|
|
|
|
const favicons = fs.readdirSync('./public/favicon/prod');
|
|
const faviconSubPath = env.USE_DEV_COLORS ? '/favicon/dev' : '/favicon/prod';
|
|
function buildFaviconRewrite(source) {
|
|
return {
|
|
destination: String.prototype.concat(faviconSubPath, source),
|
|
source,
|
|
};
|
|
}
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
output: 'standalone',
|
|
eslint: {
|
|
ignoreDuringBuilds: true,
|
|
},
|
|
experimental: {
|
|
outputFileTracingRoot: path.join(__dirname, '../../'),
|
|
},
|
|
reactStrictMode: true,
|
|
transpilePackages: ['ui'],
|
|
async rewrites() {
|
|
return [...favicons.map((fileName) => buildFaviconRewrite(`/${fileName}`))];
|
|
},
|
|
};
|
|
|
|
module.exports = nextConfig;
|