File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/project/types/website Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -106,10 +106,17 @@ export async function updateAliases(
106106
107107 // Write the redirect file
108108 if ( allOutputFiles . find ( ( outputFile ) => outputFile === targetFile ) ) {
109- // Do not, this is the same name as an output file!
110- warning (
111- `Aliases that you have created would overwrite the output file ${ targetFile } . The aliases file was not created.` ,
112- ) ;
109+ for (
110+ const offendingAlias of targetHrefs . filter (
111+ ( targetHref ) =>
112+ targetHref . href ===
113+ relative ( dirname ( targetHref . outputFile ) , targetFile ) ,
114+ )
115+ ) {
116+ warning (
117+ `Requested alias ${ targetFile } -> ${ offendingAlias . outputFile } would overwrite the target. Skipping.` ,
118+ ) ;
119+ }
113120 } else {
114121 // Write, this is a safe file
115122 writeMultipleRedirectPage ( targetFile , redirects ) ;
You can’t perform that action at this time.
0 commit comments