Add asset prefix on export

This commit is contained in:
DefectingCat
2022-09-01 18:00:54 +08:00
parent 92b6e52828
commit e06078646b

View File

@ -18,6 +18,7 @@
/**
* @type {import('next').NextConfig}
*/
const isExport = process.env.NEXT_BUILD === 'export';
const nextConfig = {
/* config options here */
reactStrictMode: true,
@ -25,11 +26,11 @@ const nextConfig = {
experimental: {
// runtime: 'nodejs',
// outputStandalone: true,
images:
process.env.NEXT_BUILD === 'export'
? { allowFutureImage: true, unoptimized: true }
: { allowFutureImage: true },
images: isExport
? { allowFutureImage: true, unoptimized: true }
: { allowFutureImage: true },
},
assetPrefix: isExport ? './' : undefined,
// images:
// process.env.NEXT_BUILD === 'export'
// ? {