Skip to content

chore: Add explicit dependency for terser-webpack-plugin - #1502

Merged
danxuliu merged 2 commits into
masterfrom
add-explicit-dependency-for-terser-webpack-plugin
Aug 8, 2026
Merged

chore: Add explicit dependency for terser-webpack-plugin#1502
danxuliu merged 2 commits into
masterfrom
add-explicit-dependency-for-terser-webpack-plugin

Conversation

@danxuliu

@danxuliu danxuliu commented Aug 7, 2026

Copy link
Copy Markdown
Member

terser-webpack-plugin was already an implicit dependency, but now it is made explicit to ensure that the build process will not break if the implicit dependency is removed.

This could happen with an update to webpack >= 5.108.0, as it replaced terser-webpack-plugin with minimizer-webpack-plugin. However, note that even if terser-webpack-plugin was also replaced with minimizer-webpack-plugin in webpack.config.js in the PDF viewer the build could still break, as the latest webpack-vue-config version (7.0.3) also uses both webpack >= 5.108.0 and terser-webpack-plugin without depending on the later.

terser-webpack-plugin was already an implicit dependency, but now it is
made explicit to ensure that the build process will not break if the
implicit dependency is removed.

This could happen with an update to webpack >= 5.108.0, as it replaced
terser-webpack-plugin with minimizer-webpack-plugin. However, note that
even if terser-webpack-plugin was also replaced with
minimizer-webpack-plugin in webpack.config.js in the PDF viewer the
build could still break, as the latest webpack-vue-config version
(7.0.3) also uses both webpack >= 5.108.0 and terser-webpack-plugin
without depending on the later.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu

danxuliu commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

/backport to stable34 please

@danxuliu

danxuliu commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

/backport to stable33 please

@danxuliu

danxuliu commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

/backport to stable32 please

Comment thread package.json
"adm-zip": "^0.6.0",
"axios": "^1.13.6",
"cli-progress": "^3.12.0",
"terser-webpack-plugin": "^5.6.1",

@ShGKme ShGKme Aug 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dependency isn't used directly by the files_pdfviewer itself. It is used by its dependency - the @nextcloud/webpack-vue-config.

  • If @nextcloud/webpack-vue-config updates, for example, to use minimizer-webpack-plugin - it will break again.
  • If somebody checks the list of dependencies, it can be found that this one is never imported by the app and accidentally removed

The proper fix should be on the library side:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dependency isn't used directly by the files_pdfviewer itself. It is used by its dependency - the @nextcloud/webpack-vue-config.

It is... or what am I missing? 🤔

const TerserPlugin = require('terser-webpack-plugin')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I see, correct

@danxuliu

danxuliu commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@danxuliu
danxuliu marked this pull request as ready for review August 8, 2026 21:04
@danxuliu
danxuliu merged commit 05d3cdb into master Aug 8, 2026
36 checks passed
@danxuliu
danxuliu deleted the add-explicit-dependency-for-terser-webpack-plugin branch August 8, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants