2024-03-12 10:40:53 +00:00
|
|
|
let baseAssetUrl = process.env.ASSET_URL ?? '/';
|
|
|
|
if (!baseAssetUrl.endsWith('/')) baseAssetUrl += '/';
|
|
|
|
|
|
|
|
let basePath = process.env.BASE_PATH ?? '';
|
|
|
|
if (basePath.endsWith('/')) basePath = basePath.slice(0, -1);
|
|
|
|
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
const nextConfig = {
|
|
|
|
images: {
|
|
|
|
unoptimized: true
|
|
|
|
},
|
|
|
|
basePath,
|
|
|
|
async redirects() {
|
|
|
|
return [...(basePath ? [{
|
|
|
|
source: '/',
|
|
|
|
destination: basePath,
|
|
|
|
permanent: false,
|
|
|
|
basePath: false
|
|
|
|
}] : []), {
|
|
|
|
source: '/',
|
|
|
|
destination: '/dashboard',
|
|
|
|
permanent: false
|
|
|
|
}, {
|
|
|
|
source: '/chuni',
|
|
|
|
destination: '/chuni/dashboard',
|
|
|
|
permanent: false
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
env: {
|
|
|
|
NEXT_PUBLIC_BASE_PATH: basePath,
|
|
|
|
NEXT_PUBLIC_ASSET_URL: baseAssetUrl
|
|
|
|
},
|
|
|
|
sassOptions: {
|
|
|
|
additionalData: `$asset-url: "${baseAssetUrl}";`
|
2024-03-24 10:04:59 +00:00
|
|
|
},
|
|
|
|
experimental: {
|
|
|
|
instrumentationHook: true
|
|
|
|
},
|
|
|
|
productionBrowserSourceMaps: true
|
2024-03-12 10:40:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default nextConfig;
|