File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/nextjs/src/config Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -679,6 +679,8 @@ function addRewriteFramesLoader(
679679 target : 'server' | 'client' ,
680680 userNextConfig : NextConfigObject ,
681681) : void {
682+ // Nextjs will use `basePath` in place of `assetPrefix` if it's defined but `assetPrefix` is not
683+ const assetPrefix = userNextConfig . assetPrefix || userNextConfig . basePath || '' ;
682684 const replacements = {
683685 server : [
684686 [
@@ -693,9 +695,7 @@ function addRewriteFramesLoader(
693695 '__ASSET_PREFIX_PATH__' ,
694696 // Get the path part of `assetPrefix`, minus any trailing slash. (We use a placeholder for the origin if
695697 // `assetPreix` doesn't include one. Since we only care about the path, it doesn't matter what it is.)
696- userNextConfig . assetPrefix
697- ? new URL ( userNextConfig . assetPrefix , 'http://dogs.are.great' ) . pathname . replace ( / \/ $ / , '' )
698- : '' ,
698+ assetPrefix ? new URL ( assetPrefix , 'http://dogs.are.great' ) . pathname . replace ( / \/ $ / , '' ) : '' ,
699699 ] ,
700700 ] ,
701701 } ;
You can’t perform that action at this time.
0 commit comments