File tree 1 file changed +19
-0
lines changed 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -753,6 +753,19 @@ function prepareOutDir(
753
753
config . publicDir &&
754
754
fs . existsSync ( config . publicDir )
755
755
) {
756
+ if ( ! areSeparateFolders ( outDir , config . publicDir ) ) {
757
+ config . logger . warn (
758
+ colors . yellow (
759
+ `\n${ colors . bold (
760
+ `(!)` ,
761
+ ) } The public directory feature may not work correctly. outDir ${ colors . white (
762
+ colors . dim ( outDir ) ,
763
+ ) } and publicDir ${ colors . white (
764
+ colors . dim ( config . publicDir ) ,
765
+ ) } are not separate folders.\n`,
766
+ ) ,
767
+ )
768
+ }
756
769
copyDir ( config . publicDir , outDir )
757
770
}
758
771
}
@@ -1223,3 +1236,9 @@ export function toOutputFilePathWithoutRuntime(
1223
1236
1224
1237
export const toOutputFilePathInCss = toOutputFilePathWithoutRuntime
1225
1238
export const toOutputFilePathInHtml = toOutputFilePathWithoutRuntime
1239
+
1240
+ function areSeparateFolders ( a : string , b : string ) {
1241
+ const na = normalizePath ( a )
1242
+ const nb = normalizePath ( b )
1243
+ return na !== nb && ! na . startsWith ( nb + '/' ) && ! nb . startsWith ( na + '/' )
1244
+ }
You can’t perform that action at this time.
0 commit comments