-
-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add copy-cmaps script to Parcel and Parcel 2 samples
- Loading branch information
Showing
4 changed files
with
34 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const pdfjsDistPath = path.dirname(require.resolve('pdfjs-dist/package.json')); | ||
const sourceDir = path.join(pdfjsDistPath, 'cmaps'); | ||
|
||
const targetDir = path.join('dist', 'cmaps'); | ||
|
||
// Ensure target directory exists | ||
fs.mkdirSync(targetDir, { recursive: true }); | ||
|
||
// Copy all files from the source directory to the target directory | ||
const files = fs.readdirSync(sourceDir); | ||
files.forEach((file) => { | ||
fs.copyFileSync(path.join(sourceDir, file), path.join(targetDir, file)); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const pdfjsDistPath = path.dirname(require.resolve('pdfjs-dist/package.json')); | ||
const sourceDir = path.join(pdfjsDistPath, 'cmaps'); | ||
|
||
const targetDir = path.join('dist', 'cmaps'); | ||
|
||
// Ensure target directory exists | ||
fs.mkdirSync(targetDir, { recursive: true }); | ||
|
||
// Copy all files from the source directory to the target directory | ||
const files = fs.readdirSync(sourceDir); | ||
files.forEach((file) => { | ||
fs.copyFileSync(path.join(sourceDir, file), path.join(targetDir, file)); | ||
}); |