forked from sk1982/actaeon
39 lines
974 B
JavaScript
39 lines
974 B
JavaScript
|
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}";`
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export default nextConfig;
|