Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: webpack-contrib/terser-webpack-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: aa12914c34f3eac7280052dad3de465a163630d7
Choose a base ref
...
head repository: webpack-contrib/terser-webpack-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 491b2fd25dd42723ba3368ff15a8aa32f647d8a4
Choose a head ref
Loading
Showing with 38,126 additions and 17,523 deletions.
  1. +1 −2 .editorconfig
  2. +4 −1 .eslintrc.js
  3. +1 −1 .github/ISSUE_TEMPLATE.md
  4. +95 −0 .github/workflows/nodejs.yml
  5. +1 −0 .gitignore
  6. +1 −0 .husky/.gitignore
  7. +4 −0 .husky/commit-msg
  8. +4 −0 .husky/pre-commit
  9. +0 −5 .prettierrc.js
  10. +369 −0 CHANGELOG.md
  11. +75 −230 README.md
  12. +0 −201 azure-pipelines.yml
  13. +2 −2 babel.config.js
  14. +1 −1 commitlint.config.js
  15. +0 −6 husky.config.js
  16. +3 −0 jest.config.js
  17. +2 −2 lint-staged.config.js
  18. +22,521 −8,116 package-lock.json
  19. +52 −46 package.json
  20. +0 −112 src/TaskRunner.js
  21. +1 −1 src/cjs.js
  22. +556 −299 src/index.js
  23. +205 −111 src/minify.js
  24. +57 −75 src/options.json
  25. +0 −21 src/worker.js
  26. +1,544 −132 test/TerserPlugin.test.js
  27. +2,620 −49 test/__snapshots__/TerserPlugin.test.js.snap
  28. +327 −587 test/__snapshots__/cache-option.test.js.snap
  29. +0 −108 test/__snapshots__/chunkFilter-option.test.js.snap
  30. +210 −510 test/__snapshots__/exclude-option.test.js.snap
  31. +5,256 −1,133 test/__snapshots__/extractComments-option.test.js.snap
  32. +213 −521 test/__snapshots__/include-option.test.js.snap
  33. +64 −403 test/__snapshots__/minify-option.test.js.snap
  34. +0 −231 test/__snapshots__/parallel-option-failure.test.js.snap
  35. +102 −35 test/__snapshots__/parallel-option.test.js.snap
  36. +0 −161 test/__snapshots__/sourceMap-option.test.js.snap
  37. +0 −153 test/__snapshots__/supports-multicompiler.test.js.snap
  38. +545 −565 test/__snapshots__/terserOptions-option.test.js.snap
  39. +632 −1,082 test/__snapshots__/test-option.test.js.snap
  40. +178 −0 test/__snapshots__/validate-options.test.js.snap
  41. +0 −209 test/__snapshots__/validation.test.js.snap
  42. +0 −48 test/__snapshots__/warningsFilter-option.test.js.snap
  43. +141 −25 test/__snapshots__/worker.test.js.snap
  44. +395 −280 test/cache-option.test.js
  45. +0 −44 test/chunkFilter-option.test.js
  46. +5 −5 test/cjs.test.js
  47. +37 −69 test/exclude-option.test.js
  48. +502 −226 test/extractComments-option.test.js
  49. +7 −0 test/fixtures/asset-resource.js
  50. +2 −0 test/fixtures/comments.js
  51. +2 −0 test/fixtures/copy.cjs
  52. +2 −0 test/fixtures/copy.js
  53. +2 −0 test/fixtures/copy.mjs
  54. +5 −0 test/fixtures/emit-loader.js
  55. +1 −0 test/fixtures/emitted.js
  56. 0 test/fixtures/empty.js
  57. +7 −4 test/fixtures/entry.mjs
  58. +7 −0 test/fixtures/file-loader.js
  59. +1 −0 test/fixtures/file.js
  60. +7 −0 test/fixtures/file.worker.js
  61. +2 −0 test/fixtures/import-export/entry.js
  62. +2 −0 test/fixtures/minify/es6.js
  63. +1 −0 test/fixtures/shebang-1.js
  64. +3 −0 test/fixtures/shebang.js
  65. +10 −0 test/fixtures/worker-loader.js
  66. +0 −96 test/helpers.js
  67. +16 −0 test/helpers/BrokenCodePlugin.js
  68. +31 −0 test/helpers/EmitNewAsset.js
  69. +16 −0 test/helpers/ExistingCommentsFile.js
  70. +24 −0 test/helpers/ModifyExistingAsset.js
  71. +10 −0 test/helpers/compile.js
  72. +9 −0 test/helpers/countPlugins.js
  73. +22 −0 test/helpers/execute.js
  74. +31 −0 test/helpers/getCompiler.js
  75. +3 −0 test/helpers/getErrors.js
  76. +3 −0 test/helpers/getWarnings.js
  77. +29 −0 test/helpers/index.js
  78. +18 −0 test/helpers/normalizeErrors.js
  79. +23 −0 test/helpers/readAsset.js
  80. +11 −0 test/helpers/readAssets.js
  81. +28 −0 test/helpers/snapshotResolver.js
  82. +37 −69 test/include-option.test.js
  83. +189 −196 test/minify-option.test.js
  84. +0 −105 test/parallel-option-failure.test.js
  85. +223 −89 test/parallel-option.test.js
  86. +0 −177 test/sourceMap-option.test.js
  87. +0 −102 test/supports-multicompiler.test.js
  88. +261 −481 test/terserOptions-option.test.js
  89. +71 −111 test/test-option.test.js
  90. +16 −69 test/{validation.test.js → validate-options.test.js}
  91. +0 −144 test/warningsFilter-option.test.js
  92. +255 −72 test/worker.test.js
  93. +13 −0 tsconfig.json
3 changes: 1 addition & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -9,5 +9,4 @@ insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = true
trim_trailing_whitespace = false
trim_trailing_whitespace = false
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
root: true,
extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'],
extends: ["@webpack-contrib/eslint-config-webpack", "prettier"],
rules: {
"import/no-namespace": "off",
},
};
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
You arrived at this template because you felt none of the other options
matched the kind of issue you'd like to report. Please use this opportunity to
tell us about your particular type of issue so we can try to accomodate
tell us about your particular type of issue so we can try to accommodate
similar issues in the future.
PLEASE do note, if you're using this to report an issue already covered by the
95 changes: 95 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: terser-webpack-plugin

on:
push:
branches:
- master
- next
pull_request:
branches:
- master
- next

jobs:
lint:
name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

strategy:
matrix:
os: [ubuntu-latest]
node-version: [12.x]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Use latest NPM
run: sudo npm i -g npm

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Security audit
run: npm run security

- name: Check commit message
uses: wagoid/commitlint-github-action@v1

test:
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 12.x, 14.x]
webpack-version: [latest]

runs-on: ${{ matrix.os }}

steps:
- name: Setup Git
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf input

- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Use latest NPM on ubuntu/macos
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: sudo npm i -g npm

- name: Use latest NPM on windows
if: matrix.os == 'windows-latest'
run: npm i -g npm

- name: Install dependencies
run: npm ci

- name: Install webpack ${{ matrix.webpack-version }}
run: npm i webpack@${{ matrix.webpack-version }}

- name: Run tests for webpack version ${{ matrix.webpack-version }}
run: npm run test:coverage -- --ci

- name: Submit coverage data to codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ npm-debug.log*
/local
/reports
/node_modules
/test/outputs

.DS_Store
Thumbs.db
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
5 changes: 0 additions & 5 deletions .prettierrc.js

This file was deleted.

Loading