parent
44023b8589
commit
149ee5cff0
@ -1,12 +1,7 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
|
|
||||||
const basePath = '/html';
|
|
||||||
|
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
output: 'export',
|
output: 'export',
|
||||||
basePath,
|
...(process.env.NODE_ENV === 'production' ? { distDir: 'dist' } : {}),
|
||||||
env: { basePath },
|
|
||||||
...(process.env.NODE_ENV === 'production' ? { distDir: 'html' } : {}),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
|
|
||||||
export default function ImageWithBasePath(props: any) {
|
export default function ImageWithBasePath(props: any) {
|
||||||
const imgSrc = process.env.NODE_ENV === 'development' ? `${process.env.basePath}/${props?.src || ''}` : props?.src;
|
const imgSrc = props?.src;
|
||||||
return <Image {...props} src={imgSrc} alt={props?.alt} />;
|
return <Image {...props} src={imgSrc} alt={props?.alt} />;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue