Skip to content

build(deps): declare terser-webpack-plugin as a dev dependency - #1794

Merged
FresnelR27 merged 1 commit into
developfrom
build/terser-plugin-dev-dependency
Sep 14, 2026
Merged

FresnelR27 merged 1 commit into
developfrom
build/terser-plugin-dev-dependency

Conversation

@Harry19081

Copy link
Copy Markdown
Member

Problem

terser-webpack-plugin sits in dependencies, but only config/webpack.config.js requires it. It never reaches the app bundle. Dependabot classifies alerts by whether a package is reachable from dependencies, and this plugin's peer webpack pulls in webpack-cli and webpack-dev-server. As a result, 15 open alerts in pure build and dev-server tooling are labeled runtime: fast-uri, browserslist, baseline-browser-mapping, qs, uuid, and ws.

That hides the few alerts that really do ship in the desktop app. The only vulnerable runtime reachability left without this plugin is @xmldom/xmldom (via mammoth), linkify-it, and prismjs.

Solution

Move terser-webpack-plugin (same ^5.3.10 specifier) from dependencies to devDependencies, next to webpack and the other build plugins. The lockfile change is limited to moving the same importer entry between the two blocks. packages and snapshots are untouched, so every install resolves and links exactly the same tree.

Potential risks

  • Production-only installs. The move would only matter if something installed with devDependencies excluded, such as pnpm install --prod or NODE_ENV=production. No workflow, script, or config does that, and webpack itself is already a devDependency, so such an install could not build anyway.
  • Tooling that reads dependency placement. Checked the CI workflows, scripts/ci, scripts/quality, config/dependency-cruiser.cjs, and knip.json; none reads the dependencies/devDependencies split.
  • Merge conflicts. chore(deps): patch vulnerable transitive npm dependencies #1792 and build(deps): stop installing unused node-sass #1793 also edit pnpm-lock.yaml. This PR's hunks sit in the importer blocks, away from theirs, but a rebase conflict would be resolved with pnpm install --lockfile-only.
  • Rollback. Revert the commit. There is no runtime, data, or configuration effect.

Verification

  • Lockfile. pnpm install --lockfile-only (fresh registry metadata) produces only the 3-line importer move, and re-running it leaves the lockfile unchanged.
  • Installed tree. Parsed both lockfiles: packages and snapshots are identical to develop, and pnpm install --frozen-lockfile succeeds.
  • Classification. pnpm why terser-webpack-plugin lists it under devDependencies. Recomputing reachability from dependencies on the develop lockfile, the vulnerable runtime set shrinks to @xmldom/xmldom, linkify-it, and prismjs.
  • Not run. Build, tests, and lint were not re-run locally, because the installed dependency tree is byte-for-byte the same; CI runs typecheck, full lint, and unit tests. There is no visual evidence because nothing user-visible changes.
  • Hooks. Committed from a git worktree. Hooks ran (lint-staged formatted package.json; no TypeScript or Rust was staged), but the Pre-commit hook ran. trailer is not appended in a worktree.

The plugin is only required by config/webpack.config.js. Listing it
under dependencies made Dependabot classify webpack's toolchain,
including webpack-dev-server, as runtime code. The installed dependency
tree is unchanged.
@FresnelR27
FresnelR27 merged commit 49ce3e0 into develop Sep 14, 2026
14 checks passed
Harry19081 added a commit that referenced this pull request Sep 14, 2026
Resolve the pnpm-lock.yaml conflict with #1793 (drop the unused
node-sass peer) and #1794 (move terser-webpack-plugin to
devDependencies). Start from this branch's lockfile and reconcile it
to develop's manifest with pnpm 9.15.4 `install --lockfile-only`
(prefer-offline off). All 20 patched package versions are kept; the
header and importers match develop.
@Harry19081 Harry19081 added maintenance Maintenance, CI, build, release, cleanup, or tooling work dev-tooling Developer tooling, build, CI, tests, diagnostics, or release labels Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-tooling Developer tooling, build, CI, tests, diagnostics, or release maintenance Maintenance, CI, build, release, cleanup, or tooling work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants