vite 7.2.1 → 7.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/chunks/config.js +11 -4
- package/package.json +1 -1
|
@@ -2406,6 +2406,16 @@ function emptyDir(dir, skip) {
|
|
|
2406
2406
|
});
|
|
2407
2407
|
}
|
|
2408
2408
|
}
|
|
2409
|
+
function copyDir(srcDir, destDir) {
|
|
2410
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
2411
|
+
for (const file of fs.readdirSync(srcDir)) {
|
|
2412
|
+
const srcFile = path.resolve(srcDir, file);
|
|
2413
|
+
if (srcFile === destDir) continue;
|
|
2414
|
+
const destFile = path.resolve(destDir, file);
|
|
2415
|
+
if (fs.statSync(srcFile).isDirectory()) copyDir(srcFile, destFile);
|
|
2416
|
+
else fs.copyFileSync(srcFile, destFile);
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2409
2419
|
const ERR_SYMLINK_IN_RECURSIVE_READDIR = "ERR_SYMLINK_IN_RECURSIVE_READDIR";
|
|
2410
2420
|
async function recursiveReaddir(dir) {
|
|
2411
2421
|
if (!fs.existsSync(dir)) return [];
|
|
@@ -33938,10 +33948,7 @@ function prepareOutDir(outDirs, emptyOutDir, environment) {
|
|
|
33938
33948
|
}).filter(Boolean), ".git"]);
|
|
33939
33949
|
if (environment.config.build.copyPublicDir && publicDir && fs.existsSync(publicDir)) {
|
|
33940
33950
|
if (!areSeparateFolders(outDir, publicDir)) environment.logger.warn(import_picocolors$5.default.yellow(`\n${import_picocolors$5.default.bold(`(!)`)} The public directory feature may not work correctly. outDir ${import_picocolors$5.default.white(import_picocolors$5.default.dim(outDir))} and publicDir ${import_picocolors$5.default.white(import_picocolors$5.default.dim(publicDir))} are not separate folders.\n`));
|
|
33941
|
-
|
|
33942
|
-
recursive: true,
|
|
33943
|
-
mode: fs.constants.COPYFILE_FICLONE
|
|
33944
|
-
});
|
|
33951
|
+
copyDir(publicDir, outDir);
|
|
33945
33952
|
}
|
|
33946
33953
|
}
|
|
33947
33954
|
}
|