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.11k stars 867 forks source link

production use terser-webpack-plugin no show #1681

Closed poohlaha closed 6 months ago

poohlaha commented 7 months ago

Description

I use the terser webpack plugin plugin with webpack5 in a production environment:

minimizer.push(new TerserWebpackPlugin())

I saw that all the nodes in canvas were loaded, and the text was also cut.

image

A blank space page

It's okay in the testing environment。

env:
react: 18.2.0
react-pdf: 7.6.0
webpack: 5.88.2
terser-webpack-plugin: 5.3.9

Environment

wojtekmaj commented 6 months ago

For starters, I don't understand why would you manually add terser-webpack-plugin if that's what Webpack uses for minification out of the box 🤔

I was not able to reproduce your issue on included Webpack 5 sample. When building for production and serving the output directory using serve I got, as expected:

image
wojtekmaj commented 6 months ago

I'm closing this because of no reply, but I'm happy to look into this if a reproducible example is provided.