Skip to content

Commit

Permalink
chore: add copy-worker script
Browse files Browse the repository at this point in the history
  • Loading branch information
cyntler committed Jun 28, 2024
1 parent 9416fa7 commit 0e43462
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"prettier:fix": "prettier --write .",
"storybook:build": "rm -rf storybook-static && storybook build",
"deploy": "npm run storybook:build && gh-pages --nojekyll -d storybook-static --message 'feat: storybook deploy'",
"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",
"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",
"release": "release-it && npm run deploy",
"build-readme-toc": "npx doctoc README.md --title '## Table of Contents'",
"prepublish": "npm run build-readme-toc"
Expand Down
10 changes: 10 additions & 0 deletions scripts/copy-worker.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import path from "node:path";
import fs from "node:fs";
import { createRequire } from "node:module";

const require = createRequire(import.meta.url);

const pdfjsDistPath = path.dirname(require.resolve("pdfjs-dist/package.json"));
const pdfWorkerPath = path.join(pdfjsDistPath, "build", "pdf.worker.mjs");

fs.copyFileSync(pdfWorkerPath, "./dist/pdf.worker.mjs");

0 comments on commit 0e43462

Please sign in to comment.