Skip to content

Commit

Permalink
Use fs.cpSync instead of fs.mkdirSync and fs.copyFileSync
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Jul 3, 2024
1 parent e737025 commit 574a324
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sample/create-react-app-5/scripts/copy-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@ const pdfWorkerPath = path.join(pdfjsDistPath, 'build', 'pdf.worker.mjs');
const targetDir = 'public';
const targetPath = path.join(targetDir, 'pdf.worker.mjs');

// Ensure target directory exists
fs.mkdirSync(targetDir, { recursive: true });

// Copy file
fs.copyFileSync(pdfWorkerPath, targetPath);
fs.cpSync(pdfWorkerPath, targetPath, { recursive: true });

0 comments on commit 574a324

Please sign in to comment.