webpack / webpack/minimizer-webpack-plugin
Automatically pick up `.terserrc`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 165
- Avg merge
- 20h 43m
- Merged PRs (30d)
- 37
Description
- webpack Version: 5.31.0
- terser-webpack-plugin Version: 5.1.1
Feature Proposal
Configuration could be automatically picked up by looking for .terserrc in the same directory as webpack.config.js like Parcel does:
https://github.com/parcel-bundler/parcel/blob/39ff8330d68c6c0e01d9e8471dd94ce1eb2e62ec/packages/optimizers/terser/src/TerserOptimizer.js#L23
Feature Use Case
Parcel v2 lets me customize the minification step of Tercer by using a configuration file. It'd be great if webpack did this natively as well so that I don't have to install, require, and call new TerserPlugin() in webpack.config.js
.terserc also seen on the standard-things/esm repo, which loads it manually.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the minimizer plugin's configuration entry points and webpack.config.js handling, then compare the linked Parcel TerserOptimizer.js behavior. Confirm how .terserrc should be discovered and merged, and use the existing test suite to verify automatic loading without manually constructing TerserPlugin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100