wojtekmaj / react-pdf

Display PDFs in your React app as easily as if they were images.
https://projects.wojtekmaj.pl/react-pdf
MIT License
9.24k stars 877 forks source link

react-pdf v7.4.0 significantly increased build time #1618

Closed keremcanb closed 7 months ago

keremcanb commented 11 months ago

Before you start - checklist

Description

We are developing a create-react-app based SPA. Before, our Bamboo builds took about 10 minutes to complete. After installing and began using react-pdf v7.4.0, builds are taking about 15-20 minutes to complete.

Steps to reproduce

  1. Install react-pdf v7.4.0
  2. Add this line to scripts section of package. json: "prebuild": "cp ./node_modules/pdfjs-dist/build/pdf.worker.js public/js"
  3. Use it like this:
    useEffect(() => {
        pdfjs.GlobalWorkerOptions.workerSrc = `${process.env.PUBLIC_URL}/js/pdf.worker.js`;
    }, []);

Expected behavior

Builds to complete in 10 minutes.

Actual behavior

Builds to complete in 15-20 minutes.

Additional information

No response

Environment

wojtekmaj commented 11 months ago

On my sample repo, I have not noticed build time jumping significantly. Certainly not by 5-10 minutes, where the build itself takes about 5 seconds. Might be something specific to your configuration. However, without any knowledge what happens during your build, and without a reproducible example, I will not be able to help you out with Webpack performance problem you're having.

Wild guess, you may be unnecessarily transpiling dependencies with some super slow tools. Double check your config.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

github-actions[bot] commented 7 months ago

This issue was closed because it has been stalled for 14 days with no activity.