Automatically pick up `.terserrc`

未关闭
#389 15 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript
领域
build-system

调研方向

先阅读 minimizer 插件的配置入口以及对 webpack.config.js 的处理,然后对比链接中的 Parcel TerserOptimizer.js 行为。确认应如何发现并合并 .terserrc,并使用现有测试套件验证自动加载,而不是手动构造 TerserPlugin。

由索引模型根据 Issue 内容生成。

描述

  • 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.

主要语言
JavaScript
星标
2k
派生
165
平均合并
2 天 2 小时
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

webpack/minimizer-webpack-plugin 的其他 Issue

查看 webpack/minimizer-webpack-plugin 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。