Skip to content

Commit

Permalink
Merge pull request storybookjs#14448 from storybookjs/fix-build-stati…
Browse files Browse the repository at this point in the history
…c-symlinks

Core: Fix symlinks in static dir when building static Storybook
  • Loading branch information
shilman authored Apr 2, 2021
2 parents d9dcd16 + 3e7dfde commit b499cf4
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 b499cf4

Please sign in to comment.