-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Webpack 5 procedure for react-pdf (seems to work now)
- Loading branch information
Showing
3 changed files
with
5 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,7 @@ | ||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
|
||
const pdfjsDistPath = path.dirname(require.resolve('pdfjs-dist/package.json')); | ||
const pdfWorkerPath = path.join(pdfjsDistPath, 'build', 'pdf.worker.js'); | ||
|
||
const targetDir = 'public'; | ||
const targetPath = path.join(targetDir, 'pdf.worker.js'); | ||
|
||
// Ensure target directory exists | ||
fs.mkdirSync(targetDir, { recursive: true }); | ||
|
||
// Copy file | ||
fs.copyFileSync(pdfWorkerPath, targetPath); | ||
|
||
// Copy js9 | ||
fs.copy(path.dirname(require.resolve('js9/package.json')), path.join(targetDir, 'js9')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters