Skip to content

Commit 0e43462

Browse files
committed
chore: add copy-worker script
1 parent 9416fa7 commit 0e43462

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"prettier:fix": "prettier --write .",
4242
"storybook:build": "rm -rf storybook-static && storybook build",
4343
"deploy": "npm run storybook:build && gh-pages --nojekyll -d storybook-static --message 'feat: storybook deploy'",
44-
"prerelease": "git checkout main && git pull && npm run prettier:check && npm run lint && npm run test && npm run build && cd use-cases/nextjs && npm i && npm run build",
44+
"prerelease": "git checkout main && git pull && npm run prettier:check && npm run lint && npm run test && npm run build && cd use-cases/nextjs && npm i && npm run build && node ./scripts/copy-worker.mjs",
4545
"release": "release-it && npm run deploy",
4646
"build-readme-toc": "npx doctoc README.md --title '## Table of Contents'",
4747
"prepublish": "npm run build-readme-toc"

scripts/copy-worker.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import path from "node:path";
2+
import fs from "node:fs";
3+
import { createRequire } from "node:module";
4+
5+
const require = createRequire(import.meta.url);
6+
7+
const pdfjsDistPath = path.dirname(require.resolve("pdfjs-dist/package.json"));
8+
const pdfWorkerPath = path.join(pdfjsDistPath, "build", "pdf.worker.mjs");
9+
10+
fs.copyFileSync(pdfWorkerPath, "./dist/pdf.worker.mjs");

0 commit comments

Comments
 (0)