Skip to content

Fix mime-db trimming after switching to pnpm#9102

Open
absidue wants to merge 1 commit intoFreeTubeApp:developmentfrom
absidue:mime-db-shrinking-v2
Open

Fix mime-db trimming after switching to pnpm#9102
absidue wants to merge 1 commit intoFreeTubeApp:developmentfrom
absidue:mime-db-shrinking-v2

Conversation

@absidue
Copy link
Copy Markdown
Member

@absidue absidue commented May 5, 2026

Pull Request Type

  • Bugfix

Related issue

Description

The webpack loader to remove all of the unused mime types from mime-db used a hardcoded path into the node_modules directory. As pnpm uses a different layout in the node_modules directory, the webpack loader was no longer being run. This pull request replaces the webpack loader with a resolve alias that points to a small hardcoded JSON file (mime-db is one really big JSON file) with the required mime types and extensions.

Screenshots

Before:

$ pnpm run pack
$ du -h dist/main.js
268K    dist/main.js

After:

$ pnpm run pack
$ du -h dist/main.js
124K    dist/main.js

Testing

  1. Right click on an image
  2. Click "save image as"
  3. Check that the save picker shows the correct file extension.

Desktop

  • OS: Windows
  • OS Version: 11

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 5, 2026 16:59
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: waiting for review For PRs that are complete, tested, and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants