Skip to content

Commit

Permalink
Dereference symlinks and keep original timestamps when copying static…
Browse files Browse the repository at this point in the history
… dir
  • Loading branch information
ghengeveld committed Apr 2, 2021
1 parent 60c2a4f commit 3e7dfde
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/core-server/src/utils/copy-all-static-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export async function copyAllStaticFiles(staticDirs: any[] | undefined, outputDi

// Storybook's own files should not be overwritten, so we skip such files if we find them
const skipPaths = ['index.html', 'iframe.html'].map((f) => path.join(targetPath, f));
await fs.copy(staticPath, targetPath, { filter: (_, dest) => !skipPaths.includes(dest) });
await fs.copy(staticPath, targetPath, {
dereference: true,
preserveTimestamps: true,
filter: (_, dest) => !skipPaths.includes(dest),
});
} catch (e) {
logger.error(e.message);
process.exit(-1);
Expand Down

0 comments on commit 3e7dfde

Please sign in to comment.