Files
4efe14238b fix: bundle fetching with asset prefix (#63627)
Closes: https://github.com/vercel/next.js/issues/63623

When a relative assetPrefix was set (e.g. `/custom-asset-prefix`),
bundle fetching would always return a 404 as the assetPrefix was not
removed from filesystem path

---------

Co-authored-by: JJ Kasper <[email protected]>
2024-03-29 16:38:24 -07:00

21 lines
397 B
JavaScript

const ASSET_PREFIX = 'custom-asset-prefix'
module.exports = {
assetPrefix: ASSET_PREFIX,
i18n: {
locales: ['en-US'],
defaultLocale: 'en-US',
},
async rewrites() {
return {
beforeFiles: [
{
source: `/:locale/${ASSET_PREFIX}/_next/:path*`,
destination: `/${ASSET_PREFIX}/_next/:path*`,
locale: false,
},
],
}
},
}