Skip to content

Commit d78b6bd

Browse files
ci: dual-publish release as minimizer-webpack-plugin and terser-webpack-plugin (#676)
1 parent e06c526 commit d78b6bd

18 files changed

Lines changed: 799 additions & 788 deletions

.changeset/array-of-minimizers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"terser-webpack-plugin": minor
2+
"minimizer-webpack-plugin": minor
33
---
44

55
support array of minimizers for `minify` and `terserOptions`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"terser-webpack-plugin": minor
2+
"minimizer-webpack-plugin": minor
33
---
44

55
add built-in CSS minimizers from `css-minimizer-webpack-plugin`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"terser-webpack-plugin": minor
2+
"minimizer-webpack-plugin": minor
33
---
44

55
add built-in HTML minimizers from `html-minimizer-webpack-plugin`

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
33
"changelog": [
44
"./changelog-generator.mjs",
5-
{ "repo": "webpack/terser-webpack-plugin" }
5+
{ "repo": "webpack/minimizer-webpack-plugin" }
66
],
77
"fixed": [],
88
"linked": [],

.changeset/minimizer-filter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"terser-webpack-plugin": minor
2+
"minimizer-webpack-plugin": minor
33
---
44

55
add `filter` method to minimizers, allowing a single plugin instance to handle multiple asset types
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"terser-webpack-plugin": minor
2+
"minimizer-webpack-plugin": minor
33
---
44

55
rename `terserOptions` to `minimizerOptions`; `terserOptions` is kept as a deprecated alias

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: terser-webpack-plugin
1+
name: minimizer-webpack-plugin
22

33
on:
44
push:

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
release:
17-
if: github.repository == 'webpack/terser-webpack-plugin'
17+
if: github.repository == 'webpack/minimizer-webpack-plugin' || github.repository == 'webpack/terser-webpack-plugin'
1818
name: Release
1919
runs-on: ubuntu-latest
2020
outputs:
@@ -41,3 +41,12 @@ jobs:
4141
env:
4242
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4343
NPM_TOKEN: "" # https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868
44+
45+
- name: Publish legacy alias to npm as terser-webpack-plugin
46+
if: steps.changesets.outputs.published == 'true'
47+
run: |
48+
npm pkg set name=terser-webpack-plugin
49+
npm publish --access public --provenance
50+
npm pkg set name=minimizer-webpack-plugin
51+
env:
52+
NPM_TOKEN: "" # OIDC trusted publisher; both packages must be configured on npm

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![discussion][discussion]][discussion-url]
1212
[![size][size]][size-url]
1313

14-
# terser-webpack-plugin
14+
# minimizer-webpack-plugin
1515

1616
This plugin minifies your assets in a webpack build. It ships with several
1717
built-in minimizers covering JavaScript, JSON, HTML, and CSS — pick one
@@ -51,34 +51,34 @@ file types with different minimizers (see [Examples](#examples)).
5151

5252
## Getting Started
5353

54-
Webpack v5 comes with the latest `terser-webpack-plugin` out of the box.
55-
If you are using Webpack v5 or above and wish to customize the options, you will still need to install `terser-webpack-plugin`.
56-
Using Webpack v4, you have to install `terser-webpack-plugin` v4.
54+
Webpack v5 comes with the latest `minimizer-webpack-plugin` out of the box.
55+
If you are using Webpack v5 or above and wish to customize the options, you will still need to install `minimizer-webpack-plugin`.
56+
Using Webpack v4, you have to install `terser-webpack-plugin` v4 (`minimizer-webpack-plugin` is only published for Webpack v5+).
5757

58-
To begin, you'll need to install `terser-webpack-plugin`:
58+
To begin, you'll need to install `minimizer-webpack-plugin`:
5959

6060
```console
61-
npm install terser-webpack-plugin --save-dev
61+
npm install minimizer-webpack-plugin --save-dev
6262
```
6363

6464
or
6565

6666
```console
67-
yarn add -D terser-webpack-plugin
67+
yarn add -D minimizer-webpack-plugin
6868
```
6969

7070
or
7171

7272
```console
73-
pnpm add -D terser-webpack-plugin
73+
pnpm add -D minimizer-webpack-plugin
7474
```
7575

7676
Then add the plugin to your `webpack` configuration. For example:
7777

7878
**webpack.config.js**
7979

8080
```js
81-
const TerserPlugin = require("terser-webpack-plugin");
81+
const TerserPlugin = require("minimizer-webpack-plugin");
8282

8383
module.exports = {
8484
optimization: {
@@ -212,7 +212,7 @@ Default number of concurrent runs: `os.cpus().length - 1` or `os.availableParall
212212
213213
> **Warning**
214214
>
215-
> If you use **Circle CI** or any other environment that doesn't provide the real available count of CPUs then you need to explicitly set up the number of CPUs to avoid `Error: Call retries were exceeded` (see [#143](https://github.com/webpack/terser-webpack-plugin/issues/143), [#202](https://github.com/webpack/terser-webpack-plugin/issues/202)).
215+
> If you use **Circle CI** or any other environment that doesn't provide the real available count of CPUs then you need to explicitly set up the number of CPUs to avoid `Error: Call retries were exceeded` (see [#143](https://github.com/webpack/minimizer-webpack-plugin/issues/143), [#202](https://github.com/webpack/minimizer-webpack-plugin/issues/202)).
216216
217217
#### `boolean`
218218

@@ -1033,7 +1033,7 @@ npm install --save-dev @minify-html/node
10331033
**webpack.config.js**
10341034

10351035
```js
1036-
const TerserPlugin = require("terser-webpack-plugin");
1036+
const TerserPlugin = require("minimizer-webpack-plugin");
10371037

10381038
module.exports = {
10391039
optimization: {
@@ -1062,7 +1062,7 @@ Use `swcMinifyHtml` for complete HTML documents (i.e. with a doctype and `<html>
10621062
**webpack.config.js**
10631063

10641064
```js
1065-
const TerserPlugin = require("terser-webpack-plugin");
1065+
const TerserPlugin = require("minimizer-webpack-plugin");
10661066

10671067
module.exports = {
10681068
optimization: {
@@ -1087,7 +1087,7 @@ Use `swcMinifyHtmlFragment` for partial HTML — for example, content of `<templ
10871087
**webpack.config.js**
10881088

10891089
```js
1090-
const TerserPlugin = require("terser-webpack-plugin");
1090+
const TerserPlugin = require("minimizer-webpack-plugin");
10911091

10921092
module.exports = {
10931093
optimization: {
@@ -1117,7 +1117,7 @@ module.exports = {
11171117
**webpack.config.js**
11181118

11191119
```js
1120-
const TerserPlugin = require("terser-webpack-plugin");
1120+
const TerserPlugin = require("minimizer-webpack-plugin");
11211121

11221122
module.exports = {
11231123
optimization: {
@@ -1181,7 +1181,7 @@ npm install --save-dev @swc/css
11811181
**webpack.config.js**
11821182

11831183
```js
1184-
const TerserPlugin = require("terser-webpack-plugin");
1184+
const TerserPlugin = require("minimizer-webpack-plugin");
11851185

11861186
module.exports = {
11871187
optimization: {
@@ -1209,7 +1209,7 @@ module.exports = {
12091209
**webpack.config.js**
12101210

12111211
```js
1212-
const TerserPlugin = require("terser-webpack-plugin");
1212+
const TerserPlugin = require("minimizer-webpack-plugin");
12131213

12141214
module.exports = {
12151215
optimization: {
@@ -1234,7 +1234,7 @@ module.exports = {
12341234
**webpack.config.js**
12351235

12361236
```js
1237-
const TerserPlugin = require("terser-webpack-plugin");
1237+
const TerserPlugin = require("minimizer-webpack-plugin");
12381238

12391239
module.exports = {
12401240
optimization: {
@@ -1259,7 +1259,7 @@ module.exports = {
12591259
**webpack.config.js**
12601260

12611261
```js
1262-
const TerserPlugin = require("terser-webpack-plugin");
1262+
const TerserPlugin = require("minimizer-webpack-plugin");
12631263

12641264
module.exports = {
12651265
optimization: {
@@ -1284,7 +1284,7 @@ module.exports = {
12841284
**webpack.config.js**
12851285

12861286
```js
1287-
const TerserPlugin = require("terser-webpack-plugin");
1287+
const TerserPlugin = require("minimizer-webpack-plugin");
12881288

12891289
module.exports = {
12901290
optimization: {
@@ -1309,7 +1309,7 @@ module.exports = {
13091309
**webpack.config.js**
13101310

13111311
```js
1312-
const TerserPlugin = require("terser-webpack-plugin");
1312+
const TerserPlugin = require("minimizer-webpack-plugin");
13131313

13141314
module.exports = {
13151315
optimization: {
@@ -1503,21 +1503,21 @@ module.exports = {
15031503
We welcome all contributions!
15041504
If you're new here, please take a moment to review our contributing guidelines before submitting issues or pull requests.
15051505

1506-
[CONTRIBUTING](https://github.com/webpack/terser-webpack-plugin?tab=contributing-ov-file#contributing)
1506+
[CONTRIBUTING](https://github.com/webpack/minimizer-webpack-plugin?tab=contributing-ov-file#contributing)
15071507

15081508
## License
15091509

15101510
[MIT](./LICENSE)
15111511

1512-
[npm]: https://img.shields.io/npm/v/terser-webpack-plugin.svg
1513-
[npm-url]: https://npmjs.com/package/terser-webpack-plugin
1514-
[node]: https://img.shields.io/node/v/terser-webpack-plugin.svg
1512+
[npm]: https://img.shields.io/npm/v/minimizer-webpack-plugin.svg
1513+
[npm-url]: https://npmjs.com/package/minimizer-webpack-plugin
1514+
[node]: https://img.shields.io/node/v/minimizer-webpack-plugin.svg
15151515
[node-url]: https://nodejs.org
1516-
[tests]: https://github.com/webpack/terser-webpack-plugin/workflows/terser-webpack-plugin/badge.svg
1517-
[tests-url]: https://github.com/webpack/terser-webpack-plugin/actions
1518-
[cover]: https://codecov.io/gh/webpack/terser-webpack-plugin/branch/main/graph/badge.svg
1519-
[cover-url]: https://codecov.io/gh/webpack/terser-webpack-plugin
1516+
[tests]: https://github.com/webpack/minimizer-webpack-plugin/workflows/minimizer-webpack-plugin/badge.svg
1517+
[tests-url]: https://github.com/webpack/minimizer-webpack-plugin/actions
1518+
[cover]: https://codecov.io/gh/webpack/minimizer-webpack-plugin/branch/main/graph/badge.svg
1519+
[cover-url]: https://codecov.io/gh/webpack/minimizer-webpack-plugin
15201520
[discussion]: https://img.shields.io/github/discussions/webpack/webpack
15211521
[discussion-url]: https://github.com/webpack/webpack/discussions
1522-
[size]: https://packagephobia.now.sh/badge?p=terser-webpack-plugin
1523-
[size-url]: https://packagephobia.now.sh/result?p=terser-webpack-plugin
1522+
[size]: https://packagephobia.now.sh/badge?p=minimizer-webpack-plugin
1523+
[size-url]: https://packagephobia.now.sh/result?p=minimizer-webpack-plugin

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "terser-webpack-plugin",
2+
"name": "minimizer-webpack-plugin",
33
"version": "5.5.0",
4-
"description": "Terser plugin for webpack",
4+
"description": "Minimizer plugin for webpack",
55
"keywords": [
66
"uglify",
77
"uglify-js",
@@ -29,9 +29,9 @@
2929
"optimize",
3030
"optimizer"
3131
],
32-
"homepage": "https://github.com/webpack/terser-webpack-plugin",
33-
"bugs": "https://github.com/webpack/terser-webpack-plugin/issues",
34-
"repository": "webpack/terser-webpack-plugin",
32+
"homepage": "https://github.com/webpack/minimizer-webpack-plugin",
33+
"bugs": "https://github.com/webpack/minimizer-webpack-plugin/issues",
34+
"repository": "webpack/minimizer-webpack-plugin",
3535
"funding": {
3636
"type": "opencollective",
3737
"url": "https://opencollective.com/webpack"

0 commit comments

Comments
 (0)