diff --git a/.eslintrc.js b/.eslintrc.js index 80237fa7..e8ccbff3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +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', + "import/no-namespace": "off", }, }; diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 4f14003f..00000000 --- a/.prettierrc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { singleQuote: true }; diff --git a/README.md b/README.md index ae5728a1..3b1c47f7 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Then add the plugin to your `webpack` config. For example: **webpack.config.js** ```js -const TerserPlugin = require('terser-webpack-plugin'); +const TerserPlugin = require("terser-webpack-plugin"); module.exports = { optimization: { @@ -202,7 +202,7 @@ module.exports = { // Custom logic for extract comments - const { map, code } = require('uglify-module') // Or require('./path/to/uglify-module') + const { map, code } = require("uglify-module") // Or require('./path/to/uglify-module') .minify(file, { /* Your options for minification */ }); @@ -293,7 +293,7 @@ module.exports = { minimize: true, minimizer: [ new TerserPlugin({ - extractComments: 'all', + extractComments: "all", }), ], }, @@ -387,7 +387,7 @@ module.exports = { minimizer: [ new TerserPlugin({ extractComments: { - condition: 'some', + condition: "some", filename: (fileData) => { // The "fileData" argument contains object with "filename", "basename", "query" and "hash" return `${fileData.filename}.LICENSE.txt${fileData.query}`; @@ -424,7 +424,7 @@ module.exports = { new TerserPlugin({ extractComments: { condition: /^\**!|@preserve|@license|@cc_on/i, - filename: 'extracted-comments.js', + filename: "extracted-comments.js", banner: (licenseFile) => { return `License information can be found in ${licenseFile}`; }, @@ -542,7 +542,7 @@ module.exports = { }; } - return require('uglify-js').minify(file, uglifyJsOptions); + return require("uglify-js").minify(file, uglifyJsOptions); }, }), ], diff --git a/babel.config.js b/babel.config.js index 190c3380..65000d45 100644 --- a/babel.config.js +++ b/babel.config.js @@ -7,10 +7,10 @@ module.exports = (api) => { return { presets: [ [ - '@babel/preset-env', + "@babel/preset-env", { targets: { - node: '10.13.0', + node: "10.13.0", }, }, ], diff --git a/commitlint.config.js b/commitlint.config.js index 84dcb122..69b4242c 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,3 +1,3 @@ module.exports = { - extends: ['@commitlint/config-conventional'], + extends: ["@commitlint/config-conventional"], }; diff --git a/husky.config.js b/husky.config.js index 4c2ec3ae..6cf9b3fc 100644 --- a/husky.config.js +++ b/husky.config.js @@ -1,6 +1,6 @@ module.exports = { hooks: { - 'pre-commit': 'lint-staged', - 'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS', + "pre-commit": "lint-staged", + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", }, }; diff --git a/jest.config.js b/jest.config.js index 25c9bac5..5da099d9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,3 @@ module.exports = { - testEnvironment: 'node', + testEnvironment: "node", }; diff --git a/lint-staged.config.js b/lint-staged.config.js index d48668db..dc1bf519 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,4 +1,4 @@ module.exports = { - '*.js': ['eslint --fix', 'prettier --write'], - '*.{json,md,yml,css,ts}': ['prettier --write'], + "*.js": ["eslint --fix", "prettier --write"], + "*.{json,md,yml,css,ts}": ["prettier --write"], }; diff --git a/package-lock.json b/package-lock.json index 90e3b02d..6e129200 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,9 +46,9 @@ } }, "@babel/compat-data": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.1.tgz", - "integrity": "sha512-725AQupWJZ8ba0jbKceeFblZTY90McUBWMwHhkFQ9q1zKPJ95GUktljFcgcsIVwRnTnRKlcYzfiNImg5G9m6ZQ==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.5.tgz", + "integrity": "sha512-DTsS7cxrsH3by8nqQSpFSyjSfSYl57D6Cf4q8dW3LK83tBKBDCkfcay1nYkXq1nIHXnpX8WMMb/O25HOy3h1zg==", "dev": true }, "@babel/core": { @@ -99,12 +99,12 @@ } }, "@babel/generator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz", - "integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", "dev": true, "requires": { - "@babel/types": "^7.12.1", + "@babel/types": "^7.12.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -137,14 +137,14 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.1.tgz", - "integrity": "sha512-jtBEif7jsPwP27GPHs06v4WBV0KrE8a/P7n0N0sSvHn2hwUCYnolP/CLmz51IzAW4NlN+HuoBtb9QcwnRo9F/g==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz", + "integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==", "dev": true, "requires": { - "@babel/compat-data": "^7.12.1", + "@babel/compat-data": "^7.12.5", "@babel/helper-validator-option": "^7.12.1", - "browserslist": "^4.12.0", + "browserslist": "^4.14.5", "semver": "^5.5.0" } }, @@ -231,12 +231,12 @@ } }, "@babel/helper-module-imports": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz", - "integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", "dev": true, "requires": { - "@babel/types": "^7.12.1" + "@babel/types": "^7.12.5" } }, "@babel/helper-module-transforms": { @@ -292,15 +292,15 @@ } }, "@babel/helper-replace-supers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz", - "integrity": "sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz", + "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==", "dev": true, "requires": { "@babel/helper-member-expression-to-functions": "^7.12.1", "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" } }, "@babel/helper-simple-access": { @@ -355,14 +355,14 @@ } }, "@babel/helpers": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.1.tgz", - "integrity": "sha512-9JoDSBGoWtmbay98efmT2+mySkwjzeFeAL9BuWNoVQpkPFQF8SIIFUfY5os9u8wVzglzoiPRSW7cuJmBDUt43g==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", "dev": true, "requires": { "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" } }, "@babel/highlight": { @@ -377,9 +377,9 @@ } }, "@babel/parser": { - "version": "7.12.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz", - "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz", + "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { @@ -454,9 +454,9 @@ } }, "@babel/plugin-proposal-numeric-separator": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.1.tgz", - "integrity": "sha512-MR7Ok+Af3OhNTCxYVjJZHS0t97ydnJZt/DbR4WISO39iDnhiD8XHrY12xuSJ90FFEGjir0Fzyyn7g/zY6hxbxA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.5.tgz", + "integrity": "sha512-UiAnkKuOrCyjZ3sYNHlRlfuZJbBHknMQ9VMwVeX97Ofwx7RpD6gS2HfqTCh8KNUQgcOm8IKt103oR4KIjh7Q8g==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -1043,9 +1043,9 @@ } }, "@babel/runtime": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz", - "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", + "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -1063,17 +1063,17 @@ } }, "@babel/traverse": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz", - "integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz", + "integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.1", + "@babel/generator": "^7.12.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.1", - "@babel/types": "^7.12.1", + "@babel/parser": "^7.12.5", + "@babel/types": "^7.12.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" @@ -1097,9 +1097,9 @@ } }, "@babel/types": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", - "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", + "version": "7.12.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.6.tgz", + "integrity": "sha512-hwyjw6GvjBLiyy3W0YQf0Z5Zf4NpYejUnKFcfcUhZCSffoBBp30w6wP2Wn6pk31jMYZvcOrB/1b7cGXvEoKogA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -1515,16 +1515,16 @@ "dev": true }, "@jest/console": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.1.tgz", - "integrity": "sha512-cjqcXepwC5M+VeIhwT6Xpi/tT4AiNzlIx8SMJ9IihduHnsSrnWNvTBfKIpmqOOCNOPqtbBx6w2JqfoLOJguo8g==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", + "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^26.6.1", - "jest-util": "^26.6.1", + "jest-message-util": "^26.6.2", + "jest-util": "^26.6.2", "slash": "^3.0.0" }, "dependencies": { @@ -1571,34 +1571,34 @@ } }, "@jest/core": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.1.tgz", - "integrity": "sha512-p4F0pgK3rKnoS9olXXXOkbus1Bsu6fd8pcvLMPsUy4CVXZ8WSeiwQ1lK5hwkCIqJ+amZOYPd778sbPha/S8Srw==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", + "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", "dev": true, "requires": { - "@jest/console": "^26.6.1", - "@jest/reporters": "^26.6.1", - "@jest/test-result": "^26.6.1", - "@jest/transform": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/console": "^26.6.2", + "@jest/reporters": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.6.1", - "jest-config": "^26.6.1", - "jest-haste-map": "^26.6.1", - "jest-message-util": "^26.6.1", + "jest-changed-files": "^26.6.2", + "jest-config": "^26.6.3", + "jest-haste-map": "^26.6.2", + "jest-message-util": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.1", - "jest-resolve-dependencies": "^26.6.1", - "jest-runner": "^26.6.1", - "jest-runtime": "^26.6.1", - "jest-snapshot": "^26.6.1", - "jest-util": "^26.6.1", - "jest-validate": "^26.6.1", - "jest-watcher": "^26.6.1", + "jest-resolve": "^26.6.2", + "jest-resolve-dependencies": "^26.6.3", + "jest-runner": "^26.6.3", + "jest-runtime": "^26.6.3", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "jest-watcher": "^26.6.2", "micromatch": "^4.0.2", "p-each-series": "^2.1.0", "rimraf": "^3.0.0", @@ -1692,53 +1692,53 @@ } }, "@jest/environment": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.1.tgz", - "integrity": "sha512-GNvHwkOFJtNgSwdzH9flUPzF9AYAZhUg124CBoQcwcZCM9s5TLz8Y3fMtiaWt4ffbigoetjGk5PU2Dd8nLrSEw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", + "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", "dev": true, "requires": { - "@jest/fake-timers": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", - "jest-mock": "^26.6.1" + "jest-mock": "^26.6.2" } }, "@jest/fake-timers": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.1.tgz", - "integrity": "sha512-T/SkMLgOquenw/nIisBRD6XAYpFir0kNuclYLkse5BpzeDUukyBr+K31xgAo9M0hgjU9ORlekAYPSzc0DKfmKg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", + "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@sinonjs/fake-timers": "^6.0.1", "@types/node": "*", - "jest-message-util": "^26.6.1", - "jest-mock": "^26.6.1", - "jest-util": "^26.6.1" + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" } }, "@jest/globals": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.1.tgz", - "integrity": "sha512-acxXsSguuLV/CeMYmBseefw6apO7NuXqpE+v5r3yD9ye2PY7h1nS20vY7Obk2w6S7eJO4OIAJeDnoGcLC/McEQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", + "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", "dev": true, "requires": { - "@jest/environment": "^26.6.1", - "@jest/types": "^26.6.1", - "expect": "^26.6.1" + "@jest/environment": "^26.6.2", + "@jest/types": "^26.6.2", + "expect": "^26.6.2" } }, "@jest/reporters": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.1.tgz", - "integrity": "sha512-J6OlXVFY3q1SXWJhjme5i7qT/BAZSikdOK2t8Ht5OS32BDo6KfG5CzIzzIFnAVd82/WWbc9Hb7SJ/jwSvVH9YA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", + "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.6.1", - "@jest/test-result": "^26.6.1", - "@jest/transform": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/console": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", @@ -1749,16 +1749,16 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.6.1", - "jest-resolve": "^26.6.1", - "jest-util": "^26.6.1", - "jest-worker": "^26.6.1", + "jest-haste-map": "^26.6.2", + "jest-resolve": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", "node-notifier": "^8.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", "string-length": "^4.0.1", "terminal-link": "^2.0.0", - "v8-to-istanbul": "^6.0.1" + "v8-to-istanbul": "^7.0.0" }, "dependencies": { "ansi-styles": { @@ -1804,9 +1804,9 @@ } }, "@jest/source-map": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.5.0.tgz", - "integrity": "sha512-jWAw9ZwYHJMe9eZq/WrsHlwF8E3hM9gynlcDpOyCb9bR8wEd9ZNBZCi7/jZyzHxC7t3thZ10gO2IDhu0bPKS5g==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", + "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", "dev": true, "requires": { "callsites": "^3.0.0", @@ -1815,46 +1815,46 @@ } }, "@jest/test-result": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.1.tgz", - "integrity": "sha512-wqAgIerIN2gSdT2A8WeA5+AFh9XQBqYGf8etK143yng3qYd0mF0ie2W5PVmgnjw4VDU6ammI9NdXrKgNhreawg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", + "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", "dev": true, "requires": { - "@jest/console": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/console": "^26.6.2", + "@jest/types": "^26.6.2", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/test-sequencer": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.1.tgz", - "integrity": "sha512-0csqA/XApZiNeTIPYh6koIDCACSoR6hi29T61tKJMtCZdEC+tF3PoNt7MS0oK/zKC6daBgCbqXxia5ztr/NyCQ==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", + "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", "dev": true, "requires": { - "@jest/test-result": "^26.6.1", + "@jest/test-result": "^26.6.2", "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.1", - "jest-runner": "^26.6.1", - "jest-runtime": "^26.6.1" + "jest-haste-map": "^26.6.2", + "jest-runner": "^26.6.3", + "jest-runtime": "^26.6.3" } }, "@jest/transform": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.1.tgz", - "integrity": "sha512-oNFAqVtqRxZRx6vXL3I4bPKUK0BIlEeaalkwxyQGGI8oXDQBtYQBpiMe5F7qPs4QdvvFYB42gPGIMMcxXaBBxQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", + "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "babel-plugin-istanbul": "^6.0.0", "chalk": "^4.0.0", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.0.0", "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.1", + "jest-haste-map": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-util": "^26.6.1", + "jest-util": "^26.6.2", "micromatch": "^4.0.2", "pirates": "^4.0.1", "slash": "^3.0.0", @@ -1948,9 +1948,9 @@ } }, "@jest/types": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.1.tgz", - "integrity": "sha512-ywHavIKNpAVrStiRY5wiyehvcktpijpItvGiK72RAn5ctqmzvPk8OvKnvHeBqa1XdQr959CTWAJMqxI8BTibyg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", @@ -2083,9 +2083,9 @@ } }, "@types/babel__core": { - "version": "7.1.10", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.10.tgz", - "integrity": "sha512-x8OM8XzITIMyiwl5Vmo2B1cR1S1Ipkyv4mdlbJjMa1lmuKvKY9FrBbEANIaMlnWn5Rf7uO+rC/VgYabNkE17Hw==", + "version": "7.1.12", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz", + "integrity": "sha512-wMTHiiTiBAAPebqaPiPDLFA4LYPKr6Ph0Xq/6rq1Ur3v66HXyG+clfR9CNETkD7MQS8ZHvpQOtA53DLws5WAEQ==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -2216,9 +2216,9 @@ "dev": true }, "@types/node": { - "version": "14.14.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.5.tgz", - "integrity": "sha512-H5Wn24s/ZOukBmDn03nnGTp18A60ny9AmCwnEcgJiTgSGsCO7k+NWP7zjCCbhlcnVCoI+co52dUAt9GMhOSULw==" + "version": "14.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", + "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -2675,27 +2675,6 @@ "define-properties": "^1.1.3", "es-abstract": "^1.17.0", "is-string": "^1.0.5" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } } }, "array-union": { @@ -2718,27 +2697,6 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.0-next.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } } }, "arrify": { @@ -2806,9 +2764,9 @@ "dev": true }, "aws4": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", - "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, "babel-code-frame": { @@ -2871,16 +2829,16 @@ } }, "babel-jest": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.1.tgz", - "integrity": "sha512-duMWEOKrSBYRVTTNpL2SipNIWnZOjP77auOBMPQ3zXAdnDbyZQWU8r/RxNWpUf9N6cgPFecQYelYLytTVXVDtA==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", + "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", "dev": true, "requires": { - "@jest/transform": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "@types/babel__core": "^7.1.7", "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.5.0", + "babel-preset-jest": "^26.6.2", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "slash": "^3.0.0" @@ -2951,9 +2909,9 @@ } }, "babel-plugin-jest-hoist": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.5.0.tgz", - "integrity": "sha512-ck17uZFD3CDfuwCLATWZxkkuGGFhMij8quP8CNhwj8ek1mqFgbFzRJ30xwC04LLscj/aKsVFfRST+b5PT7rSuw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", + "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", "dev": true, "requires": { "@babel/template": "^7.3.3", @@ -2963,9 +2921,9 @@ } }, "babel-preset-current-node-syntax": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz", - "integrity": "sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.0.tgz", + "integrity": "sha512-mGkvkpocWJes1CmMKtgGUwCeeq0pOhALyymozzDWYomHTbDLwueDYG6p4TK1YOeYHCzBzYPsWkgTto10JubI1Q==", "dev": true, "requires": { "@babel/plugin-syntax-async-generators": "^7.8.4", @@ -2978,17 +2936,18 @@ "@babel/plugin-syntax-numeric-separator": "^7.8.3", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" } }, "babel-preset-jest": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.5.0.tgz", - "integrity": "sha512-F2vTluljhqkiGSJGBg/jOruA8vIIIL11YrxRcO7nviNTMbbofPSHwnm8mgP7d/wS7wRSexRoI6X1A6T74d4LQA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", + "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^26.5.0", - "babel-preset-current-node-syntax": "^0.1.3" + "babel-plugin-jest-hoist": "^26.6.2", + "babel-preset-current-node-syntax": "^1.0.0" } }, "balanced-match": { @@ -3130,15 +3089,15 @@ "dev": true }, "browserslist": { - "version": "4.14.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.5.tgz", - "integrity": "sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA==", + "version": "4.14.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.6.tgz", + "integrity": "sha512-zeFYcUo85ENhc/zxHbiIp0LGzzTrE2Pv2JhxvS7kpUb9Q9D38kUX6Bie7pGutJ/5iF5rOxE7CepAuWD56xJ33A==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001135", - "electron-to-chromium": "^1.3.571", - "escalade": "^3.1.0", - "node-releases": "^1.1.61" + "caniuse-lite": "^1.0.30001154", + "electron-to-chromium": "^1.3.585", + "escalade": "^3.1.1", + "node-releases": "^1.1.65" } }, "bser": { @@ -3178,23 +3137,6 @@ "ssri": "^8.0.0", "tar": "^6.0.2", "unique-filename": "^1.1.1" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } } }, "cache-base": { @@ -3214,6 +3156,16 @@ "unset-value": "^1.0.0" } }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3238,9 +3190,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001151", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001151.tgz", - "integrity": "sha512-Zh3sHqskX6mHNrqUerh+fkf0N72cMxrmflzje/JyVImfpknscMnkeJrlFGJcqTmaa0iszdYptGpWMJCRQDkBVw==", + "version": "1.0.30001157", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001157.tgz", + "integrity": "sha512-gOerH9Wz2IRZ2ZPdMfBvyOi3cjaz4O4dgNwPGzx8EhqAs4+2IL/O+fJsbt+znSigujoZG8bVcIAUM/I/E5K3MA==", "dev": true }, "capture-exit": { @@ -3425,9 +3377,9 @@ "dev": true }, "cjs-module-lexer": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.4.3.tgz", - "integrity": "sha512-5RLK0Qfs0PNDpEyBXIr3bIT1Muw3ojSlvpw6dAmkUcO0+uTrsBn7GuEIgx40u+OzbCBLDta7nvmud85P4EmTsQ==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", + "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", "dev": true }, "class-utils": { @@ -3677,9 +3629,9 @@ } }, "conventional-changelog-angular": { - "version": "5.0.11", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz", - "integrity": "sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz", + "integrity": "sha512-5GLsbnkR/7A89RyHLvvoExbiGbd9xKdKqDTrArnPbOqBqG/2wIosu0fHwpeIRI8Tl94MhVNBXcLJZl92ZQ5USw==", "dev": true, "requires": { "compare-func": "^2.0.0", @@ -3687,18 +3639,18 @@ } }, "conventional-changelog-atom": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.7.tgz", - "integrity": "sha512-7dOREZwzB+tCEMjRTDfen0OHwd7vPUdmU0llTy1eloZgtOP4iSLVzYIQqfmdRZEty+3w5Jz+AbhfTJKoKw1JeQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz", + "integrity": "sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw==", "dev": true, "requires": { "q": "^1.5.1" } }, "conventional-changelog-codemirror": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.7.tgz", - "integrity": "sha512-Oralk1kiagn3Gb5cR5BffenWjVu59t/viE6UMD/mQa1hISMPkMYhJIqX+CMeA1zXgVBO+YHQhhokEj99GP5xcg==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.8.tgz", + "integrity": "sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw==", "dev": true, "requires": { "q": "^1.5.1" @@ -3711,9 +3663,9 @@ "dev": true }, "conventional-changelog-conventionalcommits": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.4.0.tgz", - "integrity": "sha512-ybvx76jTh08tpaYrYn/yd0uJNLt5yMrb1BphDe4WBredMlvPisvMghfpnJb6RmRNcqXeuhR6LfGZGewbkRm9yA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz", + "integrity": "sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw==", "dev": true, "requires": { "compare-func": "^2.0.0", @@ -3722,26 +3674,26 @@ } }, "conventional-changelog-core": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.0.tgz", - "integrity": "sha512-8+xMvN6JvdDtPbGBqA7oRNyZD4od1h/SIzrWqHcKZjitbVXrFpozEeyn4iI4af1UwdrabQpiZMaV07fPUTGd4w==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.1.tgz", + "integrity": "sha512-8cH8/DEoD3e5Q6aeogdR5oaaKs0+mG6+f+Om0ZYt3PNv7Zo0sQhu4bMDRsqAF+UTekTAtP1W/C41jH/fkm8Jtw==", "dev": true, "requires": { "add-stream": "^1.0.0", - "conventional-changelog-writer": "^4.0.17", - "conventional-commits-parser": "^3.1.0", + "conventional-changelog-writer": "^4.0.18", + "conventional-commits-parser": "^3.2.0", "dateformat": "^3.0.0", "get-pkg-repo": "^1.0.0", "git-raw-commits": "2.0.0", "git-remote-origin-url": "^2.0.0", - "git-semver-tags": "^4.1.0", + "git-semver-tags": "^4.1.1", "lodash": "^4.17.15", - "normalize-package-data": "^2.3.5", + "normalize-package-data": "^3.0.0", "q": "^1.5.1", "read-pkg": "^3.0.0", "read-pkg-up": "^3.0.0", "shelljs": "^0.8.3", - "through2": "^3.0.0" + "through2": "^4.0.0" }, "dependencies": { "camelcase": { @@ -3804,6 +3756,12 @@ } } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "indent-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", @@ -3853,6 +3811,20 @@ "read-pkg-up": "^3.0.0", "redent": "^2.0.0", "trim-newlines": "^2.0.0" + }, + "dependencies": { + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + } } }, "minimist-options": { @@ -3935,6 +3907,20 @@ "load-json-file": "^4.0.0", "normalize-package-data": "^2.3.2", "path-type": "^3.0.0" + }, + "dependencies": { + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + } } }, "read-pkg-up": { @@ -3972,45 +3958,45 @@ } }, "conventional-changelog-ember": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.8.tgz", - "integrity": "sha512-JEMEcUAMg4Q9yxD341OgWlESQ4gLqMWMXIWWUqoQU8yvTJlKnrvcui3wk9JvnZQyONwM2g1MKRZuAjKxr8hAXA==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.9.tgz", + "integrity": "sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A==", "dev": true, "requires": { "q": "^1.5.1" } }, "conventional-changelog-eslint": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.8.tgz", - "integrity": "sha512-5rTRltgWG7TpU1PqgKHMA/2ivjhrB+E+S7OCTvj0zM/QGg4vmnVH67Vq/EzvSNYtejhWC+OwzvDrLk3tqPry8A==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.9.tgz", + "integrity": "sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA==", "dev": true, "requires": { "q": "^1.5.1" } }, "conventional-changelog-express": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.5.tgz", - "integrity": "sha512-pW2hsjKG+xNx/Qjof8wYlAX/P61hT5gQ/2rZ2NsTpG+PgV7Rc8RCfITvC/zN9K8fj0QmV6dWmUefCteD9baEAw==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.6.tgz", + "integrity": "sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ==", "dev": true, "requires": { "q": "^1.5.1" } }, "conventional-changelog-jquery": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.10.tgz", - "integrity": "sha512-QCW6wF8QgPkq2ruPaxc83jZxoWQxLkt/pNxIDn/oYjMiVgrtqNdd7lWe3vsl0hw5ENHNf/ejXuzDHk6suKsRpg==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.11.tgz", + "integrity": "sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw==", "dev": true, "requires": { "q": "^1.5.1" } }, "conventional-changelog-jshint": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.8.tgz", - "integrity": "sha512-hB/iI0IiZwnZ+seYI+qEQ4b+EMQSEC8jGIvhO2Vpz1E5p8FgLz75OX8oB1xJWl+s4xBMB6f8zJr0tC/BL7YOjw==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.9.tgz", + "integrity": "sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA==", "dev": true, "requires": { "compare-func": "^2.0.0", @@ -4024,21 +4010,21 @@ "dev": true }, "conventional-changelog-writer": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz", - "integrity": "sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw==", + "version": "4.0.18", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.18.tgz", + "integrity": "sha512-mAQDCKyB9HsE8Ko5cCM1Jn1AWxXPYV0v8dFPabZRkvsiWUul2YyAqbIaoMKF88Zf2ffnOPSvKhboLf3fnjo5/A==", "dev": true, "requires": { "compare-func": "^2.0.0", - "conventional-commits-filter": "^2.0.6", + "conventional-commits-filter": "^2.0.7", "dateformat": "^3.0.0", "handlebars": "^4.7.6", "json-stringify-safe": "^5.0.1", "lodash": "^4.17.15", - "meow": "^7.0.0", + "meow": "^8.0.0", "semver": "^6.0.0", "split": "^1.0.0", - "through2": "^3.0.0" + "through2": "^4.0.0" }, "dependencies": { "semver": { @@ -4050,9 +4036,9 @@ } }, "conventional-commits-filter": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz", - "integrity": "sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz", + "integrity": "sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA==", "dev": true, "requires": { "lodash.ismatch": "^4.4.0", @@ -4060,17 +4046,17 @@ } }, "conventional-commits-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz", - "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.0.tgz", + "integrity": "sha512-XmJiXPxsF0JhAKyfA2Nn+rZwYKJ60nanlbSWwwkGwLQFbugsc0gv1rzc7VbbUWAzJfR1qR87/pNgv9NgmxtBMQ==", "dev": true, "requires": { "JSONStream": "^1.0.4", "is-text-path": "^1.0.1", "lodash": "^4.17.15", - "meow": "^7.0.0", + "meow": "^8.0.0", "split2": "^2.0.0", - "through2": "^3.0.0", + "through2": "^4.0.0", "trim-off-newlines": "^1.0.0" } }, @@ -4157,6 +4143,12 @@ } } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "indent-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", @@ -4191,6 +4183,198 @@ "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", "dev": true }, + "meow": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", + "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "map-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "dev": true + }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, + "trim-newlines": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "dev": true + } + } + }, "minimist-options": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", @@ -4201,6 +4385,18 @@ "is-plain-obj": "^1.1.0" } }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -4314,6 +4510,30 @@ "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", "dev": true + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } } } }, @@ -4341,9 +4561,9 @@ "dev": true }, "copy-webpack-plugin": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-6.2.1.tgz", - "integrity": "sha512-VH2ZTMIBsx4p++Lmpg77adZ0KUyM5gFR/9cuTrbneNnJlcQXUFvsNariPqq2dq2kV3F2skHiDGPQCyKWy1+U0Q==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-6.3.0.tgz", + "integrity": "sha512-kQ2cGGQLO6Ov2fe7rEGVxObI17dPeFkv8bRGnUAGZehOcrrObyAR9yWYlFGlJsyWM4EeuC/ytQNQkXxjYotMzg==", "dev": true, "requires": { "cacache": "^15.0.5", @@ -4382,18 +4602,18 @@ } }, "core-js": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", - "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.7.0.tgz", + "integrity": "sha512-NwS7fI5M5B85EwpWuIwJN4i/fbisQUwLwiSNUWeXlkAZ0sbBjLEvLvFLf1uzAUV66PcEPt4xCGCmOZSxVf3xzA==", "dev": true }, "core-js-compat": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", - "integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.7.0.tgz", + "integrity": "sha512-V8yBI3+ZLDVomoWICO6kq/CD28Y4r1M7CWeO4AGpMdMfseu8bkSubBmUPySMGKRTS+su4XQ07zUkAsiu9FCWTg==", "dev": true, "requires": { - "browserslist": "^4.8.5", + "browserslist": "^4.14.6", "semver": "7.0.0" }, "dependencies": { @@ -4738,6 +4958,12 @@ "slash": "^3.0.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "meow": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", @@ -4757,6 +4983,18 @@ "yargs-parser": "^18.1.3" } }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "p-map": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", @@ -4771,6 +5009,22 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, @@ -4793,9 +5047,9 @@ "dev": true }, "diff-sequences": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.5.0.tgz", - "integrity": "sha512-ZXx86srb/iYy6jG71k++wBN9P9J05UNQ5hQHQd9MtMPvcqXPx/vKU69jfHV637D00Q2gSgPk2D+jSx3l1lDW/Q==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", + "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", "dev": true }, "dir-glob": { @@ -4917,12 +5171,30 @@ "lru-cache": "^4.1.5", "semver": "^5.6.0", "sigmund": "^1.0.1" + }, + "dependencies": { + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + } } }, "electron-to-chromium": { - "version": "1.3.584", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.584.tgz", - "integrity": "sha512-NB3DzrTzJFhWkUp+nl2KtUtoFzrfGXTir2S+BU4tXGyXH9vlluPuFpE3pTKeH7+PY460tHLjKzh6K2+TWwW+Ww==", + "version": "1.3.591", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.591.tgz", + "integrity": "sha512-ol/0WzjL4NS4Kqy9VD6xXQON91xIihDT36sYCew/G/bnd1v0/4D+kahp26JauQhgFUjrdva3kRSo7URcUmQ+qw==", "dev": true }, "emittery": { @@ -4981,9 +5253,9 @@ } }, "es-abstract": { - "version": "1.18.0-next.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", - "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", @@ -4991,7 +5263,6 @@ "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", "is-regex": "^1.1.1", "object-inspect": "^1.8.0", "object-keys": "^1.1.1", @@ -5084,9 +5355,9 @@ } }, "eslint": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.12.1.tgz", - "integrity": "sha512-HlMTEdr/LicJfN08LB3nM1rRYliDXOmfoO4vj39xN6BLpFzF00hbwBoqHk8UcJ2M/3nlARZWy/mslvGEuZFvsg==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.13.0.tgz", + "integrity": "sha512-uCORMuOO8tUzJmsdRtrvcGq5qposf7Rw0LwkTJkoDbOycVQtQjmnhZSuLQnozLE4TmAzlMVV45eCHmQ1OpDKUQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -5263,9 +5534,9 @@ } }, "eslint-config-prettier": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.14.0.tgz", - "integrity": "sha512-DbVwh0qZhAC7CNDWcq8cBdK6FcVHiMTKmCypOPWeZkp9hJ8xYwTaWSa6bb6cjfi8KOeJy0e9a8Izxyx+O4+gCQ==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz", + "integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==", "dev": true, "requires": { "get-stdin": "^6.0.0" @@ -5399,6 +5670,12 @@ "locate-path": "^2.0.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", @@ -5409,6 +5686,18 @@ "path-exists": "^3.0.0" } }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -5650,16 +5939,16 @@ } }, "expect": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.1.tgz", - "integrity": "sha512-BRfxIBHagghMmr1D2MRY0Qv5d3Nc8HCqgbDwNXw/9izmM5eBb42a2YjLKSbsqle76ozGkAEPELQX4IdNHAKRNA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", + "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "ansi-styles": "^4.0.0", "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.6.1", - "jest-message-util": "^26.6.1", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", "jest-regex-util": "^26.0.0" }, "dependencies": { @@ -5872,9 +6161,9 @@ "dev": true }, "fastq": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", - "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz", + "integrity": "sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -5908,9 +6197,9 @@ } }, "file-loader": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.1.1.tgz", - "integrity": "sha512-Klt8C4BjWSXYQAfhpYYkG4qHNTna4toMHEbWrI5IuVoxbU6uiDKeKAP99R8mmbJi3lvewn/jQBOgU4+NS3tDQw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.2.0.tgz", + "integrity": "sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==", "dev": true, "requires": { "loader-utils": "^2.0.0", @@ -6145,9 +6434,9 @@ "dev": true }, "gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true }, "get-caller-file": { @@ -6156,6 +6445,17 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-intrinsic": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", + "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "get-own-enumerable-property-symbols": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", @@ -6213,6 +6513,12 @@ "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", "dev": true }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "indent-string": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", @@ -6259,6 +6565,18 @@ "trim-newlines": "^1.0.0" } }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -6414,16 +6732,16 @@ } }, "git-raw-commits": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.7.tgz", - "integrity": "sha512-SkwrTqrDxw8y0G1uGJ9Zw13F7qu3LF8V4BifyDeiJCxSnjRGZD9SaoMiMqUvvXMXh6S3sOQ1DsBN7L2fMUZW/g==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.8.tgz", + "integrity": "sha512-6Gk7tQHGMLEL1bSnrMJTCVt2AQl4EmCcJDtzs/JJacCb2+TNEyHM67Gp7Ri9faF7OcGpjGGRjHLvs/AG7QKZ2Q==", "dev": true, "requires": { "dargs": "^7.0.0", "lodash.template": "^4.0.2", - "meow": "^7.0.0", + "meow": "^8.0.0", "split2": "^2.0.0", - "through2": "^3.0.0" + "through2": "^4.0.0" } }, "git-remote-origin-url": { @@ -6445,12 +6763,12 @@ } }, "git-semver-tags": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.0.tgz", - "integrity": "sha512-TcxAGeo03HdErzKzi4fDD+xEL7gi8r2Y5YSxH6N2XYdVSV5UkBwfrt7Gqo1b+uSHCjy/sa9Y6BBBxxFLxfbhTg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA==", "dev": true, "requires": { - "meow": "^7.0.0", + "meow": "^8.0.0", "semver": "^6.0.0" }, "dependencies": { @@ -6688,10 +7006,13 @@ } }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz", + "integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } }, "html-encoding-sniffer": { "version": "2.0.1", @@ -6801,9 +7122,9 @@ "dev": true }, "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz", + "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -6938,9 +7259,9 @@ } }, "is-core-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.0.0.tgz", - "integrity": "sha512-jq1AH6C8MuteOoBPwkxHafmByhL9j5q4OaPGdbuD+ZtQJVzH+i6E3BJDQcBA09k57i2Hh2yQbEG8yObZ0jdlWw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz", + "integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==", "dev": true, "requires": { "has": "^1.0.3" @@ -7292,14 +7613,14 @@ } }, "jest": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.1.tgz", - "integrity": "sha512-f+ahfqw3Ffy+9vA7sWFGpTmhtKEMsNAZiWBVXDkrpIO73zIz22iimjirnV78kh/eWlylmvLh/0WxHN6fZraZdA==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", + "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", "dev": true, "requires": { - "@jest/core": "^26.6.1", + "@jest/core": "^26.6.3", "import-local": "^3.0.2", - "jest-cli": "^26.6.1" + "jest-cli": "^26.6.3" }, "dependencies": { "ansi-styles": { @@ -7337,22 +7658,22 @@ "dev": true }, "jest-cli": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.1.tgz", - "integrity": "sha512-aPLoEjlwFrCWhiPpW5NUxQA1X1kWsAnQcQ0SO/fHsCvczL3W75iVAcH9kP6NN+BNqZcHNEvkhxT5cDmBfEAh+w==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", + "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", "dev": true, "requires": { - "@jest/core": "^26.6.1", - "@jest/test-result": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/core": "^26.6.3", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", "import-local": "^3.0.2", "is-ci": "^2.0.0", - "jest-config": "^26.6.1", - "jest-util": "^26.6.1", - "jest-validate": "^26.6.1", + "jest-config": "^26.6.3", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", "prompts": "^2.0.1", "yargs": "^15.4.1" } @@ -7360,12 +7681,12 @@ } }, "jest-changed-files": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.1.tgz", - "integrity": "sha512-NhSdZ5F6b/rIN5V46x1l31vrmukD/bJUXgYAY8VtP1SknYdJwjYDRxuLt7Z8QryIdqCjMIn2C0Cd98EZ4umo8Q==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", + "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "execa": "^4.0.0", "throat": "^5.0.0" }, @@ -7382,9 +7703,9 @@ } }, "execa": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", - "integrity": "sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -7455,29 +7776,29 @@ } }, "jest-config": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.1.tgz", - "integrity": "sha512-mtJzIynIwW1d1nMlKCNCQiSgWaqFn8cH/fOSNY97xG7Y9tBCZbCSuW2GTX0RPmceSJGO7l27JgwC18LEg0Vg+g==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", + "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.6.1", - "@jest/types": "^26.6.1", - "babel-jest": "^26.6.1", + "@jest/test-sequencer": "^26.6.3", + "@jest/types": "^26.6.2", + "babel-jest": "^26.6.3", "chalk": "^4.0.0", "deepmerge": "^4.2.2", "glob": "^7.1.1", "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.6.1", - "jest-environment-node": "^26.6.1", + "jest-environment-jsdom": "^26.6.2", + "jest-environment-node": "^26.6.2", "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.6.1", + "jest-jasmine2": "^26.6.3", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.1", - "jest-util": "^26.6.1", - "jest-validate": "^26.6.1", + "jest-resolve": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", "micromatch": "^4.0.2", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-styles": { @@ -7560,15 +7881,15 @@ } }, "jest-diff": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.1.tgz", - "integrity": "sha512-BBNy/zin2m4kG5In126O8chOBxLLS/XMTuuM2+YhgyHk87ewPzKTuTJcqj3lOWOi03NNgrl+DkMeV/exdvG9gg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", + "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", "dev": true, "requires": { "chalk": "^4.0.0", - "diff-sequences": "^26.5.0", + "diff-sequences": "^26.6.2", "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-styles": { @@ -7617,16 +7938,16 @@ } }, "jest-each": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.1.tgz", - "integrity": "sha512-gSn8eB3buchuq45SU7pLB7qmCGax1ZSxfaWuEFblCyNMtyokYaKFh9dRhYPujK6xYL57dLIPhLKatjmB5XWzGA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", + "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", - "jest-util": "^26.6.1", - "pretty-format": "^26.6.1" + "jest-util": "^26.6.2", + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-styles": { @@ -7666,32 +7987,32 @@ } }, "jest-environment-jsdom": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.1.tgz", - "integrity": "sha512-A17RiXuHYNVlkM+3QNcQ6n5EZyAc6eld8ra9TW26luounGWpku4tj03uqRgHJCI1d4uHr5rJiuCH5JFRtdmrcA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", + "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", "dev": true, "requires": { - "@jest/environment": "^26.6.1", - "@jest/fake-timers": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", - "jest-mock": "^26.6.1", - "jest-util": "^26.6.1", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2", "jsdom": "^16.4.0" } }, "jest-environment-node": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.1.tgz", - "integrity": "sha512-YffaCp6h0j1kbcf1NVZ7umC6CPgD67YS+G1BeornfuSkx5s3xdhuwG0DCxSiHPXyT81FfJzA1L7nXvhq50OWIg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", + "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", "dev": true, "requires": { - "@jest/environment": "^26.6.1", - "@jest/fake-timers": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", - "jest-mock": "^26.6.1", - "jest-util": "^26.6.1" + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" } }, "jest-get-type": { @@ -7701,12 +8022,12 @@ "dev": true }, "jest-haste-map": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.1.tgz", - "integrity": "sha512-9kPafkv0nX6ta1PrshnkiyhhoQoFWncrU/uUBt3/AP1r78WSCU5iLceYRTwDvJl67H3RrXqSlSVDDa/AsUB7OQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", + "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/graceful-fs": "^4.1.2", "@types/node": "*", "anymatch": "^3.0.3", @@ -7714,9 +8035,9 @@ "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", - "jest-serializer": "^26.5.0", - "jest-util": "^26.6.1", - "jest-worker": "^26.6.1", + "jest-serializer": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", "micromatch": "^4.0.2", "sane": "^4.0.3", "walker": "^1.0.7" @@ -7751,9 +8072,9 @@ } }, "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.2.1.tgz", + "integrity": "sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA==", "dev": true, "optional": true }, @@ -7785,28 +8106,28 @@ } }, "jest-jasmine2": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.1.tgz", - "integrity": "sha512-2uYdT32o/ZzSxYAPduAgokO8OlAL1YdG/9oxcEY138EDNpIK5XRRJDaGzTZdIBWSxk0aR8XxN44FvfXtHB+Fiw==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", + "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.6.1", - "@jest/source-map": "^26.5.0", - "@jest/test-result": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/environment": "^26.6.2", + "@jest/source-map": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "expect": "^26.6.1", + "expect": "^26.6.2", "is-generator-fn": "^2.0.0", - "jest-each": "^26.6.1", - "jest-matcher-utils": "^26.6.1", - "jest-message-util": "^26.6.1", - "jest-runtime": "^26.6.1", - "jest-snapshot": "^26.6.1", - "jest-util": "^26.6.1", - "pretty-format": "^26.6.1", + "jest-each": "^26.6.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-runtime": "^26.6.3", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "pretty-format": "^26.6.2", "throat": "^5.0.0" }, "dependencies": { @@ -7847,25 +8168,25 @@ } }, "jest-leak-detector": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.1.tgz", - "integrity": "sha512-j9ZOtJSJKlHjrs4aIxWjiQUjyrffPdiAQn2Iw0916w7qZE5Lk0T2KhIH6E9vfhzP6sw0Q0jtnLLb4vQ71o1HlA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", + "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", "dev": true, "requires": { "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" } }, "jest-matcher-utils": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.1.tgz", - "integrity": "sha512-9iu3zrsYlUnl8pByhREF9rr5eYoiEb1F7ymNKg6lJr/0qD37LWS5FSW/JcoDl8UdMX2+zAzabDs7sTO+QFKjCg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", + "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^26.6.1", + "jest-diff": "^26.6.2", "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-styles": { @@ -7905,17 +8226,18 @@ } }, "jest-message-util": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.1.tgz", - "integrity": "sha512-cqM4HnqncIebBNdTKrBoWR/4ufHTll0pK/FWwX0YasK+TlBQEMqw3IEdynuuOTjDPFO3ONlFn37280X48beByw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", + "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "micromatch": "^4.0.2", + "pretty-format": "^26.6.2", "slash": "^3.0.0", "stack-utils": "^2.0.2" }, @@ -8006,12 +8328,12 @@ } }, "jest-mock": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.1.tgz", - "integrity": "sha512-my0lPTBu1awY8iVG62sB2sx9qf8zxNDVX+5aFgoB8Vbqjb6LqIOsfyFA8P1z6H2IsqMbvOX9oCJnK67Y3yUIMA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", + "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/node": "*" } }, @@ -8028,16 +8350,16 @@ "dev": true }, "jest-resolve": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.1.tgz", - "integrity": "sha512-hiHfQH6rrcpAmw9xCQ0vD66SDuU+7ZulOuKwc4jpbmFFsz0bQG/Ib92K+9/489u5rVw0btr/ZhiHqBpmkbCvuQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", + "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^26.6.1", + "jest-util": "^26.6.2", "read-pkg-up": "^7.0.1", "resolve": "^1.18.1", "slash": "^3.0.0" @@ -8086,40 +8408,40 @@ } }, "jest-resolve-dependencies": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.1.tgz", - "integrity": "sha512-MN6lufbZJ3RBfTnJesZtHu3hUCBqPdHRe2+FhIt0yiqJ3fMgzWRqMRQyN/d/QwOE7KXwAG2ekZutbPhuD7s51A==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", + "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.6.1" + "jest-snapshot": "^26.6.2" } }, "jest-runner": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.1.tgz", - "integrity": "sha512-DmpNGdgsbl5s0FGkmsInmqnmqCtliCSnjWA2TFAJS1m1mL5atwfPsf+uoZ8uYQ2X0uDj4NM+nPcDnUpbNTRMBA==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", + "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", "dev": true, "requires": { - "@jest/console": "^26.6.1", - "@jest/environment": "^26.6.1", - "@jest/test-result": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/console": "^26.6.2", + "@jest/environment": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.7.1", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-config": "^26.6.1", + "jest-config": "^26.6.3", "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.6.1", - "jest-leak-detector": "^26.6.1", - "jest-message-util": "^26.6.1", - "jest-resolve": "^26.6.1", - "jest-runtime": "^26.6.1", - "jest-util": "^26.6.1", - "jest-worker": "^26.6.1", + "jest-haste-map": "^26.6.2", + "jest-leak-detector": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-resolve": "^26.6.2", + "jest-runtime": "^26.6.3", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", "source-map-support": "^0.5.6", "throat": "^5.0.0" }, @@ -8161,35 +8483,35 @@ } }, "jest-runtime": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.1.tgz", - "integrity": "sha512-7uOCNeezXDWgjEyzYbRN2ViY7xNZzusNVGAMmU0UHRUNXuY4j4GBHKGMqPo/cBPZA9bSYp+lwK2DRRBU5Dv6YQ==", - "dev": true, - "requires": { - "@jest/console": "^26.6.1", - "@jest/environment": "^26.6.1", - "@jest/fake-timers": "^26.6.1", - "@jest/globals": "^26.6.1", - "@jest/source-map": "^26.5.0", - "@jest/test-result": "^26.6.1", - "@jest/transform": "^26.6.1", - "@jest/types": "^26.6.1", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", + "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", + "dev": true, + "requires": { + "@jest/console": "^26.6.2", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/globals": "^26.6.2", + "@jest/source-map": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "@types/yargs": "^15.0.0", "chalk": "^4.0.0", - "cjs-module-lexer": "^0.4.2", + "cjs-module-lexer": "^0.6.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.2.4", - "jest-config": "^26.6.1", - "jest-haste-map": "^26.6.1", - "jest-message-util": "^26.6.1", - "jest-mock": "^26.6.1", + "jest-config": "^26.6.3", + "jest-haste-map": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.1", - "jest-snapshot": "^26.6.1", - "jest-util": "^26.6.1", - "jest-validate": "^26.6.1", + "jest-resolve": "^26.6.2", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", "slash": "^3.0.0", "strip-bom": "^4.0.0", "yargs": "^15.4.1" @@ -8244,9 +8566,9 @@ } }, "jest-serializer": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.5.0.tgz", - "integrity": "sha512-+h3Gf5CDRlSLdgTv7y0vPIAoLgX/SI7T4v6hy+TEXMgYbv+ztzbg5PSN6mUXAT/hXYHvZRWm+MaObVfqkhCGxA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", + "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", "dev": true, "requires": { "@types/node": "*", @@ -8254,26 +8576,26 @@ } }, "jest-snapshot": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.1.tgz", - "integrity": "sha512-JA7bZp7HRTIJYAi85pJ/OZ2eur2dqmwIToA5/6d7Mn90isGEfeF9FvuhDLLEczgKP1ihreBzrJ6Vr7zteP5JNA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", + "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", "dev": true, "requires": { "@babel/types": "^7.0.0", - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/babel__traverse": "^7.0.4", "@types/prettier": "^2.0.0", "chalk": "^4.0.0", - "expect": "^26.6.1", + "expect": "^26.6.2", "graceful-fs": "^4.2.4", - "jest-diff": "^26.6.1", + "jest-diff": "^26.6.2", "jest-get-type": "^26.3.0", - "jest-haste-map": "^26.6.1", - "jest-matcher-utils": "^26.6.1", - "jest-message-util": "^26.6.1", - "jest-resolve": "^26.6.1", + "jest-haste-map": "^26.6.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-resolve": "^26.6.2", "natural-compare": "^1.4.0", - "pretty-format": "^26.6.1", + "pretty-format": "^26.6.2", "semver": "^7.3.2" }, "dependencies": { @@ -8320,12 +8642,12 @@ } }, "jest-util": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.1.tgz", - "integrity": "sha512-xCLZUqVoqhquyPLuDXmH7ogceGctbW8SMyQVjD9o+1+NPWI7t0vO08udcFLVPLgKWcvc+zotaUv/RuaR6l8HIA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", + "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", @@ -8413,17 +8735,17 @@ } }, "jest-validate": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.1.tgz", - "integrity": "sha512-BEFpGbylKocnNPZULcnk+TGaz1oFZQH/wcaXlaXABbu0zBwkOGczuWgdLucUouuQqn7VadHZZeTvo8VSFDLMOA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", + "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "camelcase": "^6.0.0", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", "leven": "^3.1.0", - "pretty-format": "^26.6.1" + "pretty-format": "^26.6.2" }, "dependencies": { "ansi-styles": { @@ -8436,9 +8758,9 @@ } }, "camelcase": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.1.0.tgz", - "integrity": "sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", "dev": true }, "chalk": { @@ -8469,17 +8791,17 @@ } }, "jest-watcher": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.1.tgz", - "integrity": "sha512-0LBIPPncNi9CaLKK15bnxyd2E8OMl4kJg0PTiNOI+MXztXw1zVdtX/x9Pr6pXaQYps+eS/ts43O4+HByZ7yJSw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", + "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", "dev": true, "requires": { - "@jest/test-result": "^26.6.1", - "@jest/types": "^26.6.1", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "jest-util": "^26.6.1", + "jest-util": "^26.6.2", "string-length": "^4.0.1" }, "dependencies": { @@ -8520,9 +8842,9 @@ } }, "jest-worker": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.1.tgz", - "integrity": "sha512-R5IE3qSGz+QynJx8y+ICEkdI2OJ3RJjRQVEyCcFAd3yVhQSEtquziPO29Mlzgn07LOVE8u8jhJ1FqcwegiXWOw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", "requires": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -8653,13 +8975,21 @@ } }, "jsonfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", - "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "requires": { "graceful-fs": "^4.1.6", - "universalify": "^1.0.0" + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + } } }, "jsonparse": { @@ -8715,20 +9045,20 @@ "dev": true }, "lint-staged": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.0.tgz", - "integrity": "sha512-gjC9+HGkBubOF+Yyoj9pd52Qfm/kYB+dRX1UOgWjHKvSDYl+VHkZXlBMlqSZa2cH3Kp5/uNL480sV6e2dTgXSg==", + "version": "10.5.1", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.1.tgz", + "integrity": "sha512-fTkTGFtwFIJJzn/PbUO3RXyEBHIhbfYBE7+rJyLcOXabViaO/h6OslgeK6zpeUtzkDrzkgyAYDTLAwx6JzDTHw==", "dev": true, "requires": { "chalk": "^4.1.0", "cli-truncate": "^2.1.0", - "commander": "^6.0.0", + "commander": "^6.2.0", "cosmiconfig": "^7.0.0", - "debug": "^4.1.1", + "debug": "^4.2.0", "dedent": "^0.7.0", "enquirer": "^2.3.6", - "execa": "^4.0.3", - "listr2": "^2.6.0", + "execa": "^4.1.0", + "listr2": "^3.2.2", "log-symbols": "^4.0.0", "micromatch": "^4.0.2", "normalize-path": "^3.0.0", @@ -8807,9 +9137,9 @@ } }, "execa": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", - "integrity": "sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -8926,9 +9256,9 @@ "dev": true }, "listr2": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.2.tgz", - "integrity": "sha512-6x6pKEMs8DSIpA/tixiYY2m/GcbgMplMVmhQAaLFxEtNSKLeWTGjtmU57xvv6QCm2XcqzyNXL/cTSVf4IChCRA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.2.2.tgz", + "integrity": "sha512-AajqcZEUikF2ioph6PfH3dIuxJclhr3i3kHgTOP0xeXdWQohrvJAAmqVcV43/GI987HFY/vzT73jYXoa4esDHg==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -8937,7 +9267,7 @@ "indent-string": "^4.0.0", "log-update": "^4.0.0", "p-map": "^4.0.0", - "rxjs": "^6.6.2", + "rxjs": "^6.6.3", "through": "^2.3.8" }, "dependencies": { @@ -9197,13 +9527,12 @@ } }, "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "yallist": "^4.0.0" } }, "make-dir": { @@ -9262,9 +9591,9 @@ "dev": true }, "meow": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", - "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-8.0.0.tgz", + "integrity": "sha512-nbsTRz2fwniJBFgUkcdISq8y/q9n9VbiHYbfwklFh5V4V2uAcxtKQkDc0yCLPM/kP0d+inZBewn3zJqewHE7kg==", "dev": true, "requires": { "@types/minimist": "^1.2.0", @@ -9272,12 +9601,12 @@ "decamelize-keys": "^1.1.0", "hard-rejection": "^2.1.0", "minimist-options": "4.1.0", - "normalize-package-data": "^2.5.0", + "normalize-package-data": "^3.0.0", "read-pkg-up": "^7.0.1", "redent": "^3.0.0", "trim-newlines": "^3.0.0", - "type-fest": "^0.13.1", - "yargs-parser": "^18.1.3" + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" } }, "merge-stream": { @@ -9372,14 +9701,6 @@ "dev": true, "requires": { "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } } }, "minipass-collect": { @@ -9417,14 +9738,6 @@ "requires": { "minipass": "^3.0.0", "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } } }, "mixin-deep": { @@ -9654,21 +9967,29 @@ } }, "node-releases": { - "version": "1.1.64", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.64.tgz", - "integrity": "sha512-Iec8O9166/x2HRMJyLLLWkd0sFFLrFNy+Xf+JQfSQsdBJzPcHpNl3JQ9gD4j+aJxmCa25jNsIbM4bmACtSbkSg==", + "version": "1.1.66", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.66.tgz", + "integrity": "sha512-JHEQ1iWPGK+38VLB2H9ef2otU4l8s3yAMt9Xf934r6+ojCYDMHPMqvCc9TnzfeFSP1QEOeU6YZEd3+De0LTCgg==", "dev": true }, "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz", + "integrity": "sha512-6lUjEI0d3v6kFrtgA/lOx4zHCWULXsFNIjHolnZCKCTLA6m/G625cdn3O7eNmT0iD3jfo6HZ9cdImGZwf21prw==", "dev": true, "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", + "hosted-git-info": "^3.0.6", + "resolve": "^1.17.0", + "semver": "^7.3.2", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } } }, "normalize-path": { @@ -9694,6 +10015,12 @@ "string.prototype.padend": "^3.0.0" }, "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -9706,6 +10033,18 @@ "strip-bom": "^3.0.0" } }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -9836,13 +10175,13 @@ } }, "object.assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", - "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "dev": true, "requires": { + "call-bind": "^1.0.0", "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.0", "has-symbols": "^1.0.1", "object-keys": "^1.1.1" } @@ -9866,27 +10205,6 @@ "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "has": "^1.0.3" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } } }, "once": { @@ -10177,12 +10495,12 @@ "dev": true }, "pretty-format": { - "version": "26.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.1.tgz", - "integrity": "sha512-MeqqsP5PYcRBbGMvwzsyBdmAJ4EFX7pWFyl7x4+dMVg5pE0ZDdBIvEH2ergvIO+Gvwv1wh64YuOY9y5LuyY/GA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", "dev": true, "requires": { - "@jest/types": "^26.6.1", + "@jest/types": "^26.6.2", "ansi-regex": "^5.0.0", "ansi-styles": "^4.0.0", "react-is": "^17.0.1" @@ -10342,6 +10660,24 @@ "type-fest": "^0.6.0" }, "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "type-fest": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", @@ -10433,9 +10769,9 @@ } }, "regenerate": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", - "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", "dev": true }, "regenerate-unicode-properties": { @@ -11236,6 +11572,17 @@ "yargs": "^15.3.1" }, "dependencies": { + "conventional-changelog-conventionalcommits": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.4.0.tgz", + "integrity": "sha512-ybvx76jTh08tpaYrYn/yd0uJNLt5yMrb1BphDe4WBredMlvPisvMghfpnJb6RmRNcqXeuhR6LfGZGewbkRm9yA==", + "dev": true, + "requires": { + "compare-func": "^2.0.0", + "lodash": "^4.17.15", + "q": "^1.5.1" + } + }, "detect-indent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", @@ -11312,12 +11659,22 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.0-next.1" + } + }, + "string.prototype.trimend": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.2.tgz", + "integrity": "sha512-8oAG/hi14Z4nOVP0z6mdiVZ/wqjDtWSLygMigTzAb+7aPEDTleeFf+WrF+alzecxIRkckkJVn+dTlwzJXORATw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" }, "dependencies": { "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", @@ -11325,6 +11682,7 @@ "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", "is-regex": "^1.1.1", "object-inspect": "^1.8.0", "object-keys": "^1.1.1", @@ -11335,16 +11693,6 @@ } } }, - "string.prototype.trimend": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.2.tgz", - "integrity": "sha512-8oAG/hi14Z4nOVP0z6mdiVZ/wqjDtWSLygMigTzAb+7aPEDTleeFf+WrF+alzecxIRkckkJVn+dTlwzJXORATw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - } - }, "string.prototype.trimstart": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.2.tgz", @@ -11353,6 +11701,28 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "string_decoder": { @@ -11516,9 +11886,9 @@ } }, "tapable": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.0.0.tgz", - "integrity": "sha512-bjzn0C0RWoffnNdTzNi7rNDhs1Zlwk2tRXgk8EiHKAOX1Mag3d6T0Y5zNa7l9CJ+EoUne/0UHdwS8tMbkh9zDg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.1.1.tgz", + "integrity": "sha512-Wib1S8m2wdpLbmQz0RBEVosIyvb/ykfKXf3ZIDqvWoMg/zTNm6G/tDSuUM61J1kNCDXWJrLHGSFeMhAG+gAGpQ==", "dev": true }, "tar": { @@ -11533,14 +11903,6 @@ "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } } }, "terminal-link": { @@ -11571,9 +11933,9 @@ } }, "terser-webpack-plugin": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.0.1.tgz", - "integrity": "sha512-EwUe+XDTFf/2cAlmAlZZ7vRpNKMZUAypX2kIRm0Fmjlz4l7SqbI/VabmgiesNZW2nq/LR0N7ku/wlTQ6ygen0w==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.0.3.tgz", + "integrity": "sha512-zFdGk8Lh9ZJGPxxPE6jwysOlATWB8GMW8HcfGULWA/nPal+3VdATflQvSBSLQJRCmYZnfFJl6vkRTiwJGNgPiQ==", "dev": true, "requires": { "jest-worker": "^26.6.1", @@ -11620,13 +11982,25 @@ "dev": true }, "through2": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", - "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "requires": { - "inherits": "^2.0.4", - "readable-stream": "2 || 3" + "readable-stream": "3" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "tmpl": { @@ -11775,9 +12149,9 @@ "dev": true }, "type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.0.tgz", + "integrity": "sha512-fbDukFPnJBdn2eZ3RR+5mK2slHLFd6gYHY7jna1KWWy4Yr4XysHuCdXRzy+RiG/HwG4WJat00vdC2UHky5eKiQ==", "dev": true }, "typedarray": { @@ -11802,9 +12176,9 @@ "dev": true }, "uglify-js": { - "version": "3.11.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.4.tgz", - "integrity": "sha512-FyYnoxVL1D6+jDGQpbK5jW6y/2JlVfRfEeQ67BPCUg5wfCjaKOpr2XeceE4QL+MkhxliLtf5EbrMDZgzpt2CNw==", + "version": "3.11.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.11.5.tgz", + "integrity": "sha512-btvv/baMqe7HxP7zJSF7Uc16h1mSfuuSplT0/qdjxseesDU+yYzH33eHBH+eMdeRXwujXspaCTooWHQVVBh09w==", "dev": true }, "unicode-canonical-property-names-ecmascript": { @@ -11961,15 +12335,15 @@ "optional": true }, "v8-compile-cache": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", - "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", "dev": true }, "v8-to-istanbul": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-6.0.1.tgz", - "integrity": "sha512-PzM1WlqquhBvsV+Gco6WSFeg1AGdD53ccMRkFeyHRE/KRZaVacPOmQYP3EeVgDBtKD2BJ8kgynBQ5OtKiHCH+w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.0.0.tgz", + "integrity": "sha512-fLL2rFuQpMtm9r8hrAV2apXX/WqHJ6+IC4/eQVdMDGBUgH/YMV4Gv3duk3kjmyg6uiQWBAA9nJwue4iJUOkHeA==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.1", @@ -12034,9 +12408,9 @@ } }, "watchpack": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.0.0.tgz", - "integrity": "sha512-xSdCxxYZWNk3VK13bZRYhsQpfa8Vg63zXG+3pyU8ouqSLRCv4IGXIp9Kr226q6GBkGRlZrST2wwKtjfKz2m7Cg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.0.1.tgz", + "integrity": "sha512-vO8AKGX22ZRo6PiOFM9dC0re8IcKh8Kd/aH2zeqUc6w4/jBGlTy2P7fTC6ekT0NjVeGjgU2dGC5rNstKkeLEQg==", "dev": true, "requires": { "glob-to-regexp": "^0.4.1", @@ -12050,9 +12424,9 @@ "dev": true }, "webpack": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.3.0.tgz", - "integrity": "sha512-0LumZ36pDaWsh+PO3i6FpNQYVqNu5Rs/Jn5AoYQyHpUxIlzn5H7omwApiEzaIUeWDccExOpkNZGO6agCVSqXPg==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.4.0.tgz", + "integrity": "sha512-udpYTyqz8toTTdaOsL2QKPLeZLt2IEm9qY7yTXuFEQhKu5bk0yQD9BtAdVQksmz4jFbbWOiWmm3NHarO0zr/ng==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", @@ -12076,9 +12450,9 @@ "pkg-dir": "^4.2.0", "schema-utils": "^3.0.0", "tapable": "^2.0.0", - "terser-webpack-plugin": "^5.0.0", + "terser-webpack-plugin": "^5.0.3", "watchpack": "^2.0.0", - "webpack-sources": "^2.1.0" + "webpack-sources": "^2.1.1" }, "dependencies": { "acorn": { @@ -12088,9 +12462,9 @@ "dev": true }, "webpack-sources": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.1.0.tgz", - "integrity": "sha512-gOlNIlnBzDC4yIqRcguYXscNRfSL4KSd2EXMXxkTPCao56YW8CbjrY+EfW5fqJNOdWhlFMxGTy1ctwJgeprnXg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", + "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", "dev": true, "requires": { "source-list-map": "^2.0.1", @@ -12276,9 +12650,9 @@ } }, "ws": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz", + "integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ==", "dev": true }, "xml-name-validator": { @@ -12306,9 +12680,9 @@ "dev": true }, "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, "yaml": { @@ -12334,17 +12708,25 @@ "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" + }, + "dependencies": { + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } } }, "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true } } } diff --git a/package.json b/package.json index f1d87ef7..780d8a32 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "webpack": "^5.1.0" }, "dependencies": { - "jest-worker": "^26.6.1", + "jest-worker": "^26.6.2", "p-limit": "^3.0.2", "schema-utils": "^3.0.0", "serialize-javascript": "^5.0.1", @@ -61,25 +61,25 @@ "@types/serialize-javascript": "^4.0.0", "@webpack-contrib/defaults": "^6.3.0", "@webpack-contrib/eslint-config-webpack": "^3.0.0", - "babel-jest": "^26.6.1", - "copy-webpack-plugin": "^6.2.1", + "babel-jest": "^26.6.3", + "copy-webpack-plugin": "^6.3.0", "cross-env": "^7.0.2", "del": "^6.0.0", "del-cli": "^3.0.1", - "eslint": "^7.12.1", - "eslint-config-prettier": "^6.14.0", + "eslint": "^7.13.0", + "eslint-config-prettier": "^6.15.0", "eslint-plugin-import": "^2.22.1", - "file-loader": "^6.1.1", + "file-loader": "^6.2.0", "husky": "^4.3.0", - "jest": "^26.6.1", - "lint-staged": "^10.5.0", + "jest": "^26.6.3", + "lint-staged": "^10.5.1", "memfs": "^3.2.0", "npm-run-all": "^4.1.5", "prettier": "^2.1.2", "standard-version": "^9.0.0", "typescript": "^4.0.5", - "uglify-js": "^3.11.4", - "webpack": "^5.3.0", + "uglify-js": "^3.11.5", + "webpack": "^5.4.0", "worker-loader": "^3.0.5" }, "keywords": [ diff --git a/src/cjs.js b/src/cjs.js index baa7dacb..54bc4edf 100644 --- a/src/cjs.js +++ b/src/cjs.js @@ -1,3 +1,3 @@ -const plugin = require('./index'); +const plugin = require("./index"); module.exports = plugin.default; diff --git a/src/index.js b/src/index.js index 291a4925..8d4740fb 100644 --- a/src/index.js +++ b/src/index.js @@ -1,15 +1,15 @@ -import * as path from 'path'; -import * as os from 'os'; +import * as path from "path"; +import * as os from "os"; -import { SourceMapConsumer } from 'source-map'; -import { validate } from 'schema-utils'; -import serialize from 'serialize-javascript'; -import * as terserPackageJson from 'terser/package.json'; -import pLimit from 'p-limit'; -import Worker from 'jest-worker'; +import { SourceMapConsumer } from "source-map"; +import { validate } from "schema-utils"; +import serialize from "serialize-javascript"; +import * as terserPackageJson from "terser/package.json"; +import pLimit from "p-limit"; +import Worker from "jest-worker"; -import * as schema from './options.json'; -import { minify as minifyFn } from './minify'; +import * as schema from "./options.json"; +import { minify as minifyFn } from "./minify"; /** @typedef {import("schema-utils/declarations/validate").Schema} Schema */ /** @typedef {import("webpack").Compiler} Compiler */ @@ -84,8 +84,8 @@ class TerserPlugin { */ constructor(options = {}) { validate(/** @type {Schema} */ (schema), options, { - name: 'Terser Plugin', - baseDataPath: 'options', + name: "Terser Plugin", + baseDataPath: "options", }); const { @@ -122,7 +122,7 @@ class TerserPlugin { input.version && input.sources && Array.isArray(input.sources) && - typeof input.mappings === 'string' + typeof input.mappings === "string" ); } @@ -151,8 +151,8 @@ class TerserPlugin { error.col }]${ error.stack - ? `\n${error.stack.split('\n').slice(1).join('\n')}` - : '' + ? `\n${error.stack.split("\n").slice(1).join("\n")}` + : "" }` ); } @@ -161,7 +161,7 @@ class TerserPlugin { `${file} from Terser\n${error.message} [${file}:${error.line},${ error.col }]${ - error.stack ? `\n${error.stack.split('\n').slice(1).join('\n')}` : '' + error.stack ? `\n${error.stack.split("\n").slice(1).join("\n")}` : "" }` ); } @@ -196,7 +196,7 @@ class TerserPlugin { * @returns {Promise} */ async optimize(compiler, compilation, assets, optimizeOptions) { - const cache = compilation.getCache('TerserWebpackPlugin'); + const cache = compilation.getCache("TerserWebpackPlugin"); let numberOfAssetsForMinify = 0; const assetsForMinify = await Promise.all( Object.keys(assets) @@ -256,7 +256,7 @@ class TerserPlugin { initializedWorker = /** @type {MinifyWorker} */ - (new Worker(require.resolve('./minify'), { + (new Worker(require.resolve("./minify"), { numWorkers: numberOfWorkers, enableWorkerThreads: true, })); @@ -265,7 +265,7 @@ class TerserPlugin { const workerStdout = initializedWorker.getStdout(); if (workerStdout) { - workerStdout.on('data', (chunk) => { + workerStdout.on("data", (chunk) => { return process.stdout.write(chunk); }); } @@ -273,7 +273,7 @@ class TerserPlugin { const workerStderr = initializedWorker.getStderr(); if (workerStderr) { - workerStderr.on('data', (chunk) => { + workerStderr.on("data", (chunk) => { return process.stderr.write(chunk); }); } @@ -338,8 +338,8 @@ class TerserPlugin { extractComments: this.options.extractComments, }; - if (typeof options.minifyOptions.module === 'undefined') { - if (typeof info.javascriptModule !== 'undefined') { + if (typeof options.minifyOptions.module === "undefined") { + if (typeof info.javascriptModule !== "undefined") { options.minifyOptions.module = info.javascriptModule; } else if (/\.mjs(\?.*)?$/i.test(name)) { options.minifyOptions.module = true; @@ -381,9 +381,9 @@ class TerserPlugin { (this.options.extractComments).banner !== false && output.extractedComments && output.extractedComments.length > 0 && - output.code.startsWith('#!') + output.code.startsWith("#!") ) { - const firstNewlinePosition = output.code.indexOf('\n'); + const firstNewlinePosition = output.code.indexOf("\n"); shebang = output.code.substring(0, firstNewlinePosition); output.code = output.code.substring(firstNewlinePosition + 1); @@ -409,19 +409,19 @@ class TerserPlugin { const commentsFilename = /** @type {ExtractCommentsObject} */ (this.options.extractComments).filename || - '[file].LICENSE.txt[query]'; + "[file].LICENSE.txt[query]"; - let query = ''; + let query = ""; let filename = name; - const querySplit = filename.indexOf('?'); + const querySplit = filename.indexOf("?"); if (querySplit >= 0) { query = filename.substr(querySplit); filename = filename.substr(0, querySplit); } - const lastSlashIndex = filename.lastIndexOf('/'); + const lastSlashIndex = filename.lastIndexOf("/"); const basename = lastSlashIndex === -1 ? filename @@ -445,15 +445,15 @@ class TerserPlugin { (this.options.extractComments).banner || `For license information please see ${path .relative(path.dirname(name), output.commentsFilename) - .replace(/\\/g, '/')}`; + .replace(/\\/g, "/")}`; - if (typeof banner === 'function') { + if (typeof banner === "function") { banner = banner(output.commentsFilename); } if (banner) { output.source = new ConcatSource( - shebang ? `${shebang}\n` : '', + shebang ? `${shebang}\n` : "", `/*! ${banner} */\n`, output.source ); @@ -462,7 +462,7 @@ class TerserPlugin { const extractedCommentsString = output.extractedComments .sort() - .join('\n\n'); + .join("\n\n"); output.extractedCommentsSource = new RawSource( `${extractedCommentsString}\n` @@ -531,10 +531,10 @@ class TerserPlugin { source = new ConcatSource( Array.from( new Set([ - ...prevSource.source().split('\n\n'), - ...extractedCommentsSource.source().split('\n\n'), + ...prevSource.source().split("\n\n"), + ...extractedCommentsSource.source().split("\n\n"), ]) - ).join('\n\n') + ).join("\n\n") ); await cache.storePromise(name, eTag, source); @@ -599,7 +599,7 @@ class TerserPlugin { apply(compiler) { const { output } = compiler.options; - if (typeof this.options.terserOptions.ecma === 'undefined') { + if (typeof this.options.terserOptions.ecma === "undefined") { this.options.terserOptions.ecma = TerserPlugin.getEcmaVersion( output.environment || {} ); @@ -620,7 +620,7 @@ class TerserPlugin { }); hooks.chunkHash.tap(pluginName, (chunk, hash) => { - hash.update('TerserPlugin'); + hash.update("TerserPlugin"); hash.update(data); }); @@ -638,10 +638,10 @@ class TerserPlugin { compilation.hooks.statsPrinter.tap(pluginName, (stats) => { stats.hooks.print - .for('asset.info.minimized') - .tap('terser-webpack-plugin', (minimized, { green, formatFlag }) => + .for("asset.info.minimized") + .tap("terser-webpack-plugin", (minimized, { green, formatFlag }) => // eslint-disable-next-line no-undefined - minimized ? green(formatFlag('minimized')) : undefined + minimized ? green(formatFlag("minimized")) : undefined ); }); }); diff --git a/src/minify.js b/src/minify.js index 505d34c1..e8555d9c 100644 --- a/src/minify.js +++ b/src/minify.js @@ -1,4 +1,4 @@ -const { minify: terserMinify } = require('terser'); +const { minify: terserMinify } = require("terser"); /** @typedef {import("source-map").RawSourceMap} RawSourceMap */ /** @typedef {import("./index.js").ExtractCommentsOptions} ExtractCommentsOptions */ @@ -43,7 +43,7 @@ function buildTerserOptions(terserOptions = {}) { mangle: terserOptions.mangle == null ? true - : typeof terserOptions.mangle === 'boolean' + : typeof terserOptions.mangle === "boolean" ? terserOptions.mangle : { ...terserOptions.mangle }, // Ignoring sourceMap from options @@ -63,7 +63,7 @@ function buildTerserOptions(terserOptions = {}) { function isObject(value) { const type = typeof value; - return value != null && (type === 'object' || type === 'function'); + return value != null && (type === "object" || type === "function"); } /** @@ -84,60 +84,60 @@ function buildComments(extractComments, terserOptions, extractedComments) { ({ comments } = terserOptions.output); } - condition.preserve = typeof comments !== 'undefined' ? comments : false; + condition.preserve = typeof comments !== "undefined" ? comments : false; - if (typeof extractComments === 'boolean' && extractComments) { - condition.extract = 'some'; + if (typeof extractComments === "boolean" && extractComments) { + condition.extract = "some"; } else if ( - typeof extractComments === 'string' || + typeof extractComments === "string" || extractComments instanceof RegExp ) { condition.extract = extractComments; - } else if (typeof extractComments === 'function') { + } else if (typeof extractComments === "function") { condition.extract = extractComments; } else if (extractComments && isObject(extractComments)) { condition.extract = - typeof extractComments.condition === 'boolean' && + typeof extractComments.condition === "boolean" && extractComments.condition - ? 'some' - : typeof extractComments.condition !== 'undefined' + ? "some" + : typeof extractComments.condition !== "undefined" ? extractComments.condition - : 'some'; + : "some"; } else { // No extract // Preserve using "commentsOpts" or "some" - condition.preserve = typeof comments !== 'undefined' ? comments : 'some'; + condition.preserve = typeof comments !== "undefined" ? comments : "some"; condition.extract = false; } // Ensure that both conditions are functions - ['preserve', 'extract'].forEach((key) => { + ["preserve", "extract"].forEach((key) => { /** @type {undefined | string} */ let regexStr; /** @type {undefined | RegExp} */ let regex; switch (typeof condition[key]) { - case 'boolean': + case "boolean": condition[key] = condition[key] ? () => true : () => false; break; - case 'function': + case "function": break; - case 'string': - if (condition[key] === 'all') { + case "string": + if (condition[key] === "all") { condition[key] = () => true; break; } - if (condition[key] === 'some') { + if (condition[key] === "some") { condition[key] = /** @type {ExtractCommentsFunction} */ (( astNode, comment ) => { return ( - (comment.type === 'comment2' || comment.type === 'comment1') && + (comment.type === "comment2" || comment.type === "comment1") && /@preserve|@lic|@cc_on|^\**!/i.test(comment.value) ); }); @@ -175,7 +175,7 @@ function buildComments(extractComments, terserOptions, extractedComments) { (condition).extract(astNode, comment) ) { const commentText = - comment.type === 'comment2' + comment.type === "comment2" ? `/*${comment.value}*/` : `//${comment.value}`; @@ -253,11 +253,11 @@ function transform(options) { /** @type {InternalMinifyOptions} */ // eslint-disable-next-line no-new-func (new Function( - 'exports', - 'require', - 'module', - '__filename', - '__dirname', + "exports", + "require", + "module", + "__filename", + "__dirname", `'use strict'\nreturn ${options}` )(exports, require, module, __filename, __dirname)); diff --git a/test/TerserPlugin.test.js b/test/TerserPlugin.test.js index 76ff4d11..4de84e6a 100644 --- a/test/TerserPlugin.test.js +++ b/test/TerserPlugin.test.js @@ -1,13 +1,13 @@ -import crypto from 'crypto'; +import crypto from "crypto"; -import path from 'path'; +import path from "path"; -import { SourceMapConsumer } from 'source-map'; -import CopyWebpackPlugin from 'copy-webpack-plugin'; -import RequestShortener from 'webpack/lib/RequestShortener'; -import { javascript } from 'webpack'; +import { SourceMapConsumer } from "source-map"; +import CopyWebpackPlugin from "copy-webpack-plugin"; +import RequestShortener from "webpack/lib/RequestShortener"; +import { javascript } from "webpack"; -import TerserPlugin from '../src/index'; +import TerserPlugin from "../src/index"; import { BrokenCodePlugin, @@ -19,63 +19,63 @@ import { getWarnings, readAsset, readsAssets, -} from './helpers'; +} from "./helpers"; jest.setTimeout(10000); -describe('TerserPlugin', () => { +describe("TerserPlugin", () => { const rawSourceMap = { version: 3, - file: 'test.js', - names: ['bar', 'baz', 'n'], - sources: ['one.js', 'two.js'], - sourceRoot: 'http://example.com/www/js/', + file: "test.js", + names: ["bar", "baz", "n"], + sources: ["one.js", "two.js"], + sourceRoot: "http://example.com/www/js/", mappings: - 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA', + "CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA", }; const emptyRawSourceMap = { version: 3, sources: [], - mappings: '', + mappings: "", }; - it('should work (without options)', async () => { + it("should work (without options)", async () => { const compiler = getCompiler(); new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should work in multi compiler mode', async () => { + it("should work in multi compiler mode", async () => { const multiCompiler = getCompiler([ { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist'), - filename: '[name]-1.js', - chunkFilename: '[id]-1.[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name]-1.js", + chunkFilename: "[id]-1.[name].js", }, optimization: { minimize: false, }, }, { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist'), - filename: '[name]-2.js', - chunkFilename: '[id]-2.[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name]-2.js", + chunkFilename: "[id]-2.[name].js", }, optimization: { minimize: false, @@ -83,14 +83,14 @@ describe('TerserPlugin', () => { plugins: [new TerserPlugin()], }, { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/import-export/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/import-export/entry.js"), output: { - path: path.resolve(__dirname, './dist-MultiCompiler'), - filename: '[name]-3.js', - chunkFilename: '[id]-3.[name].js', + path: path.resolve(__dirname, "./dist-MultiCompiler"), + filename: "[name]-3.js", + chunkFilename: "[id]-3.[name].js", }, optimization: { minimize: false, @@ -109,7 +109,7 @@ describe('TerserPlugin', () => { expect(pluginCount).not.toEqual(emptyPluginCount); expect(pluginCount).toEqual(expectedPluginCount); - expect(pluginCount).toMatchSnapshot('compiler plugin count'); + expect(pluginCount).toMatchSnapshot("compiler plugin count"); }); const multiStats = await compile(multiCompiler); @@ -117,20 +117,20 @@ describe('TerserPlugin', () => { multiStats.stats.forEach((stats, index) => { expect( readsAssets(multiCompiler.compilers[index], stats) - ).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + ).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); - it('should work when some of assets do not contain source maps', async () => { + it("should work when some of assets do not contain source maps", async () => { const compiler = getCompiler({ - devtool: 'source-map', + devtool: "source-map", module: { rules: [ { test: /\.js$/i, - loader: require.resolve('./fixtures/emit-loader.js'), + loader: require.resolve("./fixtures/emit-loader.js"), }, ], }, @@ -140,37 +140,37 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should work in multi compiler mode with the one plugin', async () => { + it("should work in multi compiler mode with the one plugin", async () => { const plugins = [new TerserPlugin()]; const multiCompiler = getCompiler([ { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist'), - filename: '[name]-1.js', - chunkFilename: '[id]-1.[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name]-1.js", + chunkFilename: "[id]-1.[name].js", }, optimization: { minimize: false, }, }, { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist'), - filename: '[name]-2.js', - chunkFilename: '[id]-2.[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name]-2.js", + chunkFilename: "[id]-2.[name].js", }, optimization: { minimize: false, @@ -178,14 +178,14 @@ describe('TerserPlugin', () => { plugins, }, { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/import-export/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/import-export/entry.js"), output: { - path: path.resolve(__dirname, './dist-MultiCompiler'), - filename: '[name]-3.js', - chunkFilename: '[id]-3.[name].js', + path: path.resolve(__dirname, "./dist-MultiCompiler"), + filename: "[name]-3.js", + chunkFilename: "[id]-3.[name].js", }, optimization: { minimize: false, @@ -204,7 +204,7 @@ describe('TerserPlugin', () => { expect(pluginCount).not.toEqual(emptyPluginCount); expect(pluginCount).toEqual(expectedPluginCount); - expect(pluginCount).toMatchSnapshot('compiler plugin count'); + expect(pluginCount).toMatchSnapshot("compiler plugin count"); }); const multiStats = await compile(multiCompiler); @@ -212,24 +212,24 @@ describe('TerserPlugin', () => { multiStats.stats.forEach((stats, index) => { expect( readsAssets(multiCompiler.compilers[index], stats) - ).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + ).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); - it('should work in multi compiler mode with the one plugin and with the same file', async () => { + it("should work in multi compiler mode with the one plugin and with the same file", async () => { const plugins = [new TerserPlugin()]; const multiCompiler = getCompiler([ { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist-0'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-0"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, optimization: { minimize: false, @@ -237,14 +237,14 @@ describe('TerserPlugin', () => { plugins, }, { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist-1'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-1"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, optimization: { minimize: false, @@ -252,14 +252,14 @@ describe('TerserPlugin', () => { plugins, }, { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist-2'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-2"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, optimization: { minimize: false, @@ -267,14 +267,14 @@ describe('TerserPlugin', () => { plugins, }, { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist-3'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-3"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, optimization: { minimize: false, @@ -282,14 +282,14 @@ describe('TerserPlugin', () => { plugins, }, { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist-4'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-4"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, optimization: { minimize: false, @@ -303,25 +303,25 @@ describe('TerserPlugin', () => { multiStats.stats.forEach((stats, index) => { expect( readsAssets(multiCompiler.compilers[index], stats) - ).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + ).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); - it('should work as a plugin', async () => { + it("should work as a plugin", async () => { const compiler = getCompiler({ plugins: [new TerserPlugin()], }); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should work as a minimizer', async () => { + it("should work as a minimizer", async () => { const compiler = getCompiler({ optimization: { minimize: true, @@ -331,28 +331,28 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should work with "file-loader"', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, 'fixtures/file-loader.js'), + entry: path.resolve(__dirname, "fixtures/file-loader.js"), }); new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should work with "asset" module type', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, 'fixtures/asset-resource.js'), + entry: path.resolve(__dirname, "fixtures/asset-resource.js"), experiments: { asset: true, }, @@ -360,9 +360,9 @@ describe('TerserPlugin', () => { rules: [ { test: /emitted\.js$/i, - type: 'asset/resource', + type: "asset/resource", generator: { - filename: '[name][ext]', + filename: "[name][ext]", }, }, ], @@ -373,9 +373,9 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should work and respect "terser" errors (the "parallel" option is "true")', async () => { @@ -385,7 +385,7 @@ describe('TerserPlugin', () => { parallel: true, minify(input) { // eslint-disable-next-line global-require - return require('terser').minify(`${input}1()2()3()`); + return require("terser").minify(`${input}1()2()3()`); }, }).apply(compiler); @@ -394,8 +394,8 @@ describe('TerserPlugin', () => { expect(/node_modules(\/|\\)terser/.test(stats.compilation.errors[0])).toBe( true ); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should work and respect "terser" errors (the "parallel" option is "false")', async () => { @@ -405,7 +405,7 @@ describe('TerserPlugin', () => { parallel: false, minify(input) { // eslint-disable-next-line global-require - return require('terser').minify(`${input}1()2()3()`); + return require("terser").minify(`${input}1()2()3()`); }, }).apply(compiler); @@ -414,44 +414,44 @@ describe('TerserPlugin', () => { expect(/node_modules(\/|\\)terser/.test(stats.compilation.errors[0])).toBe( true ); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should regenerate hash', async () => { + it("should regenerate hash", async () => { const mockUpdateHashForChunk = jest.fn(); const compiler = getCompiler({ entry: { - js: path.resolve(__dirname, './fixtures/entry.js'), - mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + js: path.resolve(__dirname, "./fixtures/entry.js"), + mjs: path.resolve(__dirname, "./fixtures/entry.mjs"), importExport: path.resolve( __dirname, - './fixtures/import-export/entry.js' + "./fixtures/import-export/entry.js" ), AsyncImportExport: path.resolve( __dirname, - './fixtures/async-import-export/entry.js' + "./fixtures/async-import-export/entry.js" ), }, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].[contenthash].js', - chunkFilename: '[id].[name].[contenthash].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].[contenthash].js", + chunkFilename: "[id].[name].[contenthash].js", }, }); - compiler.hooks.thisCompilation.tap('TerserPlugin', (compilation) => { + compiler.hooks.thisCompilation.tap("TerserPlugin", (compilation) => { javascript.JavascriptModulesPlugin.getCompilationHooks( compilation - ).chunkHash.tap('TerserPlugin', mockUpdateHashForChunk); + ).chunkHash.tap("TerserPlugin", mockUpdateHashForChunk); }); new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); // On each chunk we have 2 calls (we have 1 async chunk and 4 initial). // First call do `webpack`. @@ -460,36 +460,36 @@ describe('TerserPlugin', () => { // We have 1 async chunk (1 * 2 = 2 calls) and 4 initial chunks (4 * 2 = 8 calls) expect(mockUpdateHashForChunk).toHaveBeenCalledTimes(10); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); }); - it('isSourceMap method', () => { + it("isSourceMap method", () => { expect(TerserPlugin.isSourceMap(null)).toBe(false); expect(TerserPlugin.isSourceMap()).toBe(false); expect(TerserPlugin.isSourceMap({})).toBe(false); expect(TerserPlugin.isSourceMap([])).toBe(false); - expect(TerserPlugin.isSourceMap('foo')).toBe(false); + expect(TerserPlugin.isSourceMap("foo")).toBe(false); expect(TerserPlugin.isSourceMap({ version: 3 })).toBe(false); - expect(TerserPlugin.isSourceMap({ sources: '' })).toBe(false); + expect(TerserPlugin.isSourceMap({ sources: "" })).toBe(false); expect(TerserPlugin.isSourceMap({ mappings: [] })).toBe(false); - expect(TerserPlugin.isSourceMap({ version: 3, sources: '' })).toBe(false); + expect(TerserPlugin.isSourceMap({ version: 3, sources: "" })).toBe(false); expect(TerserPlugin.isSourceMap({ version: 3, mappings: [] })).toBe(false); - expect(TerserPlugin.isSourceMap({ sources: '', mappings: [] })).toBe(false); + expect(TerserPlugin.isSourceMap({ sources: "", mappings: [] })).toBe(false); expect( - TerserPlugin.isSourceMap({ version: 3, sources: '', mappings: [] }) + TerserPlugin.isSourceMap({ version: 3, sources: "", mappings: [] }) ).toBe(false); expect(TerserPlugin.isSourceMap(rawSourceMap)).toBe(true); expect(TerserPlugin.isSourceMap(emptyRawSourceMap)).toBe(true); }); - it('buildError method', () => { - const error = new Error('Message'); + it("buildError method", () => { + const error = new Error("Message"); error.stack = null; - expect(TerserPlugin.buildError(error, 'test.js')).toMatchSnapshot(); + expect(TerserPlugin.buildError(error, "test.js")).toMatchSnapshot(); - const errorWithLineAndCol = new Error('Message'); + const errorWithLineAndCol = new Error("Message"); errorWithLineAndCol.stack = null; errorWithLineAndCol.line = 1; @@ -498,14 +498,14 @@ describe('TerserPlugin', () => { expect( TerserPlugin.buildError( errorWithLineAndCol, - 'test.js', + "test.js", // eslint-disable-next-line no-undefined undefined, new SourceMapConsumer(rawSourceMap) ) ).toMatchSnapshot(); - const otherErrorWithLineAndCol = new Error('Message'); + const otherErrorWithLineAndCol = new Error("Message"); otherErrorWithLineAndCol.stack = null; otherErrorWithLineAndCol.line = 1; @@ -514,32 +514,32 @@ describe('TerserPlugin', () => { expect( TerserPlugin.buildError( otherErrorWithLineAndCol, - 'test.js', - new RequestShortener('/example.com/www/js/'), + "test.js", + new RequestShortener("/example.com/www/js/"), new SourceMapConsumer(rawSourceMap) ) ).toMatchSnapshot(); - const errorWithStack = new Error('Message'); + const errorWithStack = new Error("Message"); - errorWithStack.stack = 'Stack'; + errorWithStack.stack = "Stack"; expect( - TerserPlugin.buildError(errorWithStack, 'test.js') + TerserPlugin.buildError(errorWithStack, "test.js") ).toMatchSnapshot(); }); - it('should respect the hash options #1', async () => { + it("should respect the hash options #1", async () => { const compiler = getCompiler({ output: { pathinfo: false, - path: path.resolve(__dirname, 'dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', - hashDigest: 'hex', + path: path.resolve(__dirname, "dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", + hashDigest: "hex", hashDigestLength: 20, - hashFunction: 'sha256', - hashSalt: 'salt', + hashFunction: "sha256", + hashSalt: "salt", }, }); @@ -547,26 +547,26 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should respect hash options #2', async () => { + it("should respect hash options #2", async () => { function sha256() { - return crypto.createHash('sha256'); + return crypto.createHash("sha256"); } const compiler = getCompiler({ output: { pathinfo: false, - path: path.resolve(__dirname, 'dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', - hashDigest: 'hex', + path: path.resolve(__dirname, "dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", + hashDigest: "hex", hashDigestLength: 20, hashFunction: sha256, - hashSalt: 'salt', + hashSalt: "salt", }, }); @@ -574,16 +574,16 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should emit an error on a broken code in parallel mode', async () => { + it("should emit an error on a broken code in parallel mode", async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/entry.js'), - two: path.resolve(__dirname, './fixtures/entry.js'), + one: path.resolve(__dirname, "./fixtures/entry.js"), + two: path.resolve(__dirname, "./fixtures/entry.js"), }, optimization: { minimize: false, @@ -597,16 +597,16 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should emit an error on a broken code in not parallel mode', async () => { + it("should emit an error on a broken code in not parallel mode", async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/entry.js'), - two: path.resolve(__dirname, './fixtures/entry.js'), + one: path.resolve(__dirname, "./fixtures/entry.js"), + two: path.resolve(__dirname, "./fixtures/entry.js"), }, optimization: { minimize: false, @@ -620,17 +620,17 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should write stdout and stderr of workers to stdout and stderr of main process in parallel mode', async () => { + it("should write stdout and stderr of workers to stdout and stderr of main process in parallel mode", async () => { const { write: stdoutWrite } = process.stdout; const { write: stderrWrite } = process.stderr; - let stdoutOutput = ''; - let stderrOutput = ''; + let stdoutOutput = ""; + let stderrOutput = ""; process.stdout.write = (str) => { stdoutOutput += str; @@ -642,8 +642,8 @@ describe('TerserPlugin', () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/empty.js'), - two: path.resolve(__dirname, './fixtures/empty.js'), + one: path.resolve(__dirname, "./fixtures/empty.js"), + two: path.resolve(__dirname, "./fixtures/empty.js"), }, }); @@ -651,32 +651,32 @@ describe('TerserPlugin', () => { parallel: true, minify: () => { // eslint-disable-next-line no-console - process.stdout.write('stdout\n'); + process.stdout.write("stdout\n"); // eslint-disable-next-line no-console - process.stderr.write('stderr\n'); + process.stderr.write("stderr\n"); - return { code: '' }; + return { code: "" }; }, }).apply(compiler); const stats = await compile(compiler); - expect(stdoutOutput).toMatchSnapshot('process stdout output'); - expect(stderrOutput).toMatchSnapshot('process stderr output'); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(stdoutOutput).toMatchSnapshot("process stdout output"); + expect(stderrOutput).toMatchSnapshot("process stderr output"); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); process.stdout.write = stdoutWrite; process.stderr.write = stderrWrite; }); - it('should write stdout and stderr of workers to stdout and stderr of main process in not parallel mode', async () => { + it("should write stdout and stderr of workers to stdout and stderr of main process in not parallel mode", async () => { const { write: stdoutWrite } = process.stdout; const { write: stderrWrite } = process.stderr; - let stdoutOutput = ''; - let stderrOutput = ''; + let stdoutOutput = ""; + let stderrOutput = ""; process.stdout.write = (str) => { stdoutOutput += str; @@ -688,8 +688,8 @@ describe('TerserPlugin', () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/empty.js'), - two: path.resolve(__dirname, './fixtures/empty.js'), + one: path.resolve(__dirname, "./fixtures/empty.js"), + two: path.resolve(__dirname, "./fixtures/empty.js"), }, }); @@ -697,52 +697,52 @@ describe('TerserPlugin', () => { parallel: false, minify: () => { // eslint-disable-next-line no-console - process.stdout.write('stdout\n'); + process.stdout.write("stdout\n"); // eslint-disable-next-line no-console - process.stderr.write('stderr\n'); + process.stderr.write("stderr\n"); - return { code: '' }; + return { code: "" }; }, }).apply(compiler); const stats = await compile(compiler); - expect(stdoutOutput).toMatchSnapshot('process stdout output'); - expect(stderrOutput).toMatchSnapshot('process stderr output'); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(stdoutOutput).toMatchSnapshot("process stdout output"); + expect(stderrOutput).toMatchSnapshot("process stderr output"); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); process.stdout.write = stdoutWrite; process.stderr.write = stderrWrite; }); - it('should work with ES modules', async () => { + it("should work with ES modules", async () => { const multiCompiler = getCompiler([ { - mode: 'production', + mode: "production", bail: true, - entry: path.resolve(__dirname, './fixtures/entry.js'), + entry: path.resolve(__dirname, "./fixtures/entry.js"), optimization: { minimize: false, }, output: { pathinfo: false, - path: path.resolve(__dirname, 'dist/a'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "dist/a"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, plugins: [ new CopyWebpackPlugin({ patterns: [ { - from: path.resolve(__dirname, './fixtures/copy.js'), + from: path.resolve(__dirname, "./fixtures/copy.js"), }, { - from: path.resolve(__dirname, './fixtures/copy.cjs'), + from: path.resolve(__dirname, "./fixtures/copy.cjs"), }, { - from: path.resolve(__dirname, './fixtures/copy.mjs'), + from: path.resolve(__dirname, "./fixtures/copy.mjs"), }, ], }), @@ -750,17 +750,17 @@ describe('TerserPlugin', () => { ], }, { - mode: 'production', + mode: "production", bail: true, - entry: path.resolve(__dirname, './fixtures/entry.js'), + entry: path.resolve(__dirname, "./fixtures/entry.js"), optimization: { minimize: false, }, output: { pathinfo: false, - path: path.resolve(__dirname, 'dist/b'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "dist/b"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, experiments: { outputModule: true, @@ -769,13 +769,13 @@ describe('TerserPlugin', () => { new CopyWebpackPlugin({ patterns: [ { - from: path.resolve(__dirname, './fixtures/copy.js'), + from: path.resolve(__dirname, "./fixtures/copy.js"), }, { - from: path.resolve(__dirname, './fixtures/copy.cjs'), + from: path.resolve(__dirname, "./fixtures/copy.cjs"), }, { - from: path.resolve(__dirname, './fixtures/copy.mjs'), + from: path.resolve(__dirname, "./fixtures/copy.mjs"), }, ], }), @@ -789,24 +789,24 @@ describe('TerserPlugin', () => { multiStats.stats.forEach((stats, index) => { expect( readsAssets(multiCompiler.compilers[index], stats) - ).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + ).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); - it('should work with child compilation', async () => { + it("should work with child compilation", async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, 'fixtures/worker-loader.js'), + entry: path.resolve(__dirname, "fixtures/worker-loader.js"), devtool: false, module: { rules: [ { test: /\.worker\.js$/i, - loader: 'worker-loader', + loader: "worker-loader", options: { - filename: '[name].worker.js', - chunkFilename: '[name].chunk.worker.js', + filename: "[name].worker.js", + chunkFilename: "[name].chunk.worker.js", }, }, ], @@ -817,12 +817,12 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should work and show minimized assets in stats', async () => { + it("should work and show minimized assets in stats", async () => { const compiler = getCompiler(); new TerserPlugin().apply(compiler); @@ -832,37 +832,37 @@ describe('TerserPlugin', () => { const printedCompressed = stringStats.match(/\[minimized]/g); expect(printedCompressed ? printedCompressed.length : 0).toBe(1); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should work and show related assets in stats', async () => { + it("should work and show related assets in stats", async () => { const compiler = getCompiler({ - entry: { comments: path.resolve(__dirname, './fixtures/comments-4.js') }, - devtool: 'source-map', + entry: { comments: path.resolve(__dirname, "./fixtures/comments-4.js") }, + devtool: "source-map", }); new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(stats.toString().indexOf('2 related asset') !== -1).toBe(true); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(stats.toString().indexOf("2 related asset") !== -1).toBe(true); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should work and generate real content hash', async () => { + it("should work and generate real content hash", async () => { const compiler = getCompiler({ entry: { - app: path.resolve(__dirname, './fixtures/async-import-export/entry'), + app: path.resolve(__dirname, "./fixtures/async-import-export/entry"), }, output: { pathinfo: false, - path: path.resolve(__dirname, 'dist'), - filename: '[name].[contenthash].[chunkhash].[fullhash].js', - chunkFilename: '[name].[contenthash].[chunkhash].[fullhash].js', + path: path.resolve(__dirname, "dist"), + filename: "[name].[contenthash].[chunkhash].[fullhash].js", + chunkFilename: "[name].[contenthash].[chunkhash].[fullhash].js", }, optimization: { minimize: false, @@ -892,30 +892,30 @@ describe('TerserPlugin', () => { expect(webpackHash).toBe(cryptoHash); } - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should work and use memory cache out of box', async () => { + it("should work and use memory cache out of box", async () => { const compiler = getCompiler({ entry: { - js: path.resolve(__dirname, './fixtures/entry.js'), - mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + js: path.resolve(__dirname, "./fixtures/entry.js"), + mjs: path.resolve(__dirname, "./fixtures/entry.mjs"), importExport: path.resolve( __dirname, - './fixtures/import-export/entry.js' + "./fixtures/import-export/entry.js" ), AsyncImportExport: path.resolve( __dirname, - './fixtures/async-import-export/entry.js' + "./fixtures/async-import-export/entry.js" ), }, cache: true, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -924,17 +924,17 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); expect(stats.compilation.emittedAssets.size).toBe(5); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); await new Promise(async (resolve) => { const newStats = await compile(compiler); expect(newStats.compilation.emittedAssets.size).toBe(0); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getWarnings(newStats)).toMatchSnapshot('errors'); - expect(getErrors(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getWarnings(newStats)).toMatchSnapshot("errors"); + expect(getErrors(newStats)).toMatchSnapshot("warnings"); resolve(); }); @@ -943,22 +943,22 @@ describe('TerserPlugin', () => { it('should work and use memory cache when the "cache" option is "true"', async () => { const compiler = getCompiler({ entry: { - js: path.resolve(__dirname, './fixtures/entry.js'), - mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + js: path.resolve(__dirname, "./fixtures/entry.js"), + mjs: path.resolve(__dirname, "./fixtures/entry.mjs"), importExport: path.resolve( __dirname, - './fixtures/import-export/entry.js' + "./fixtures/import-export/entry.js" ), AsyncImportExport: path.resolve( __dirname, - './fixtures/async-import-export/entry.js' + "./fixtures/async-import-export/entry.js" ), }, cache: true, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -967,17 +967,17 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); expect(stats.compilation.emittedAssets.size).toBe(5); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); await new Promise(async (resolve) => { const newStats = await compile(compiler); expect(newStats.compilation.emittedAssets.size).toBe(0); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getWarnings(newStats)).toMatchSnapshot('errors'); - expect(getErrors(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getWarnings(newStats)).toMatchSnapshot("errors"); + expect(getErrors(newStats)).toMatchSnapshot("warnings"); resolve(); }); @@ -986,22 +986,22 @@ describe('TerserPlugin', () => { it('should work and use memory cache when the "cache" option is "true" and the asset has been changed', async () => { const compiler = getCompiler({ entry: { - js: path.resolve(__dirname, './fixtures/entry.js'), - mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + js: path.resolve(__dirname, "./fixtures/entry.js"), + mjs: path.resolve(__dirname, "./fixtures/entry.mjs"), importExport: path.resolve( __dirname, - './fixtures/import-export/entry.js' + "./fixtures/import-export/entry.js" ), AsyncImportExport: path.resolve( __dirname, - './fixtures/async-import-export/entry.js' + "./fixtures/async-import-export/entry.js" ), }, cache: true, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -1010,19 +1010,19 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); expect(stats.compilation.emittedAssets.size).toBe(5); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); - new ModifyExistingAsset({ name: 'js.js' }).apply(compiler); + new ModifyExistingAsset({ name: "js.js" }).apply(compiler); await new Promise(async (resolve) => { const newStats = await compile(compiler); expect(newStats.compilation.emittedAssets.size).toBe(1); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getWarnings(newStats)).toMatchSnapshot('errors'); - expect(getErrors(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getWarnings(newStats)).toMatchSnapshot("errors"); + expect(getErrors(newStats)).toMatchSnapshot("warnings"); resolve(); }); @@ -1030,24 +1030,24 @@ describe('TerserPlugin', () => { it('should work with source map and use memory cache when the "cache" option is "true"', async () => { const compiler = getCompiler({ - devtool: 'source-map', + devtool: "source-map", entry: { - js: path.resolve(__dirname, './fixtures/entry.js'), - mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + js: path.resolve(__dirname, "./fixtures/entry.js"), + mjs: path.resolve(__dirname, "./fixtures/entry.mjs"), importExport: path.resolve( __dirname, - './fixtures/import-export/entry.js' + "./fixtures/import-export/entry.js" ), AsyncImportExport: path.resolve( __dirname, - './fixtures/async-import-export/entry.js' + "./fixtures/async-import-export/entry.js" ), }, cache: true, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -1056,17 +1056,17 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); expect(stats.compilation.emittedAssets.size).toBe(10); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); await new Promise(async (resolve) => { const newStats = await compile(compiler); expect(newStats.compilation.emittedAssets.size).toBe(0); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getWarnings(newStats)).toMatchSnapshot('errors'); - expect(getErrors(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getWarnings(newStats)).toMatchSnapshot("errors"); + expect(getErrors(newStats)).toMatchSnapshot("warnings"); resolve(); }); @@ -1074,24 +1074,24 @@ describe('TerserPlugin', () => { it('should work with source map and use memory cache when the "cache" option is "true" and the asset has been changed', async () => { const compiler = getCompiler({ - devtool: 'source-map', + devtool: "source-map", entry: { - js: path.resolve(__dirname, './fixtures/entry.js'), - mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + js: path.resolve(__dirname, "./fixtures/entry.js"), + mjs: path.resolve(__dirname, "./fixtures/entry.mjs"), importExport: path.resolve( __dirname, - './fixtures/import-export/entry.js' + "./fixtures/import-export/entry.js" ), AsyncImportExport: path.resolve( __dirname, - './fixtures/async-import-export/entry.js' + "./fixtures/async-import-export/entry.js" ), }, cache: true, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -1100,19 +1100,19 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); expect(stats.compilation.emittedAssets.size).toBe(10); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); - new ModifyExistingAsset({ name: 'js.js' }).apply(compiler); + new ModifyExistingAsset({ name: "js.js" }).apply(compiler); await new Promise(async (resolve) => { const newStats = await compile(compiler); expect(newStats.compilation.emittedAssets.size).toBe(2); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getWarnings(newStats)).toMatchSnapshot('errors'); - expect(getErrors(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getWarnings(newStats)).toMatchSnapshot("errors"); + expect(getErrors(newStats)).toMatchSnapshot("warnings"); resolve(); }); @@ -1121,16 +1121,16 @@ describe('TerserPlugin', () => { it('should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true"', async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), - two: path.resolve(__dirname, './fixtures/comments-2.js'), - three: path.resolve(__dirname, './fixtures/comments-3.js'), - four: path.resolve(__dirname, './fixtures/comments-4.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), + two: path.resolve(__dirname, "./fixtures/comments-2.js"), + three: path.resolve(__dirname, "./fixtures/comments-3.js"), + four: path.resolve(__dirname, "./fixtures/comments-4.js"), }, cache: true, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -1139,17 +1139,17 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); expect(stats.compilation.emittedAssets.size).toBe(10); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); await new Promise(async (resolve) => { const newStats = await compile(compiler); expect(newStats.compilation.emittedAssets.size).toBe(0); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getWarnings(newStats)).toMatchSnapshot('errors'); - expect(getErrors(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getWarnings(newStats)).toMatchSnapshot("errors"); + expect(getErrors(newStats)).toMatchSnapshot("warnings"); resolve(); }); @@ -1158,16 +1158,16 @@ describe('TerserPlugin', () => { it('should work, extract comments in different files and use memory cache memory cache when the "cache" option is "true" and the asset has been changed', async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), - two: path.resolve(__dirname, './fixtures/comments-2.js'), - three: path.resolve(__dirname, './fixtures/comments-3.js'), - four: path.resolve(__dirname, './fixtures/comments-4.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), + two: path.resolve(__dirname, "./fixtures/comments-2.js"), + three: path.resolve(__dirname, "./fixtures/comments-3.js"), + four: path.resolve(__dirname, "./fixtures/comments-4.js"), }, cache: true, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -1176,19 +1176,19 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); expect(stats.compilation.emittedAssets.size).toBe(10); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); - new ModifyExistingAsset({ name: 'two.js', comment: true }).apply(compiler); + new ModifyExistingAsset({ name: "two.js", comment: true }).apply(compiler); await new Promise(async (resolve) => { const newStats = await compile(compiler); expect(newStats.compilation.emittedAssets.size).toBe(2); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getWarnings(newStats)).toMatchSnapshot('errors'); - expect(getErrors(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getWarnings(newStats)).toMatchSnapshot("errors"); + expect(getErrors(newStats)).toMatchSnapshot("warnings"); resolve(); }); @@ -1197,39 +1197,39 @@ describe('TerserPlugin', () => { it('should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true"', async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), - two: path.resolve(__dirname, './fixtures/comments-2.js'), - three: path.resolve(__dirname, './fixtures/comments-3.js'), - four: path.resolve(__dirname, './fixtures/comments-4.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), + two: path.resolve(__dirname, "./fixtures/comments-2.js"), + three: path.resolve(__dirname, "./fixtures/comments-3.js"), + four: path.resolve(__dirname, "./fixtures/comments-4.js"), }, cache: true, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); new TerserPlugin({ extractComments: { - filename: 'licenses.txt', + filename: "licenses.txt", }, }).apply(compiler); const stats = await compile(compiler); expect(stats.compilation.emittedAssets.size).toBe(6); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); await new Promise(async (resolve) => { const newStats = await compile(compiler); expect(newStats.compilation.emittedAssets.size).toBe(0); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getWarnings(newStats)).toMatchSnapshot('errors'); - expect(getErrors(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getWarnings(newStats)).toMatchSnapshot("errors"); + expect(getErrors(newStats)).toMatchSnapshot("warnings"); resolve(); }); @@ -1238,41 +1238,41 @@ describe('TerserPlugin', () => { it('should work, extract comments in one file and use memory cache memory cache when the "cache" option is "true" and the asset has been changed', async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), - two: path.resolve(__dirname, './fixtures/comments-2.js'), - three: path.resolve(__dirname, './fixtures/comments-3.js'), - four: path.resolve(__dirname, './fixtures/comments-4.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), + two: path.resolve(__dirname, "./fixtures/comments-2.js"), + three: path.resolve(__dirname, "./fixtures/comments-3.js"), + four: path.resolve(__dirname, "./fixtures/comments-4.js"), }, cache: true, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); new TerserPlugin({ extractComments: { - filename: 'licenses.txt', + filename: "licenses.txt", }, }).apply(compiler); const stats = await compile(compiler); expect(stats.compilation.emittedAssets.size).toBe(6); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); - new ModifyExistingAsset({ name: 'two.js', comment: true }).apply(compiler); + new ModifyExistingAsset({ name: "two.js", comment: true }).apply(compiler); await new Promise(async (resolve) => { const newStats = await compile(compiler); expect(newStats.compilation.emittedAssets.size).toBe(2); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getWarnings(newStats)).toMatchSnapshot('errors'); - expect(getErrors(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getWarnings(newStats)).toMatchSnapshot("errors"); + expect(getErrors(newStats)).toMatchSnapshot("warnings"); resolve(); }); @@ -1281,22 +1281,22 @@ describe('TerserPlugin', () => { it('should work and do not use memory cache when the "cache" option is "false"', async () => { const compiler = getCompiler({ entry: { - js: path.resolve(__dirname, './fixtures/entry.js'), - mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + js: path.resolve(__dirname, "./fixtures/entry.js"), + mjs: path.resolve(__dirname, "./fixtures/entry.mjs"), importExport: path.resolve( __dirname, - './fixtures/import-export/entry.js' + "./fixtures/import-export/entry.js" ), AsyncImportExport: path.resolve( __dirname, - './fixtures/async-import-export/entry.js' + "./fixtures/async-import-export/entry.js" ), }, cache: false, output: { - path: path.resolve(__dirname, './dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -1305,17 +1305,17 @@ describe('TerserPlugin', () => { const stats = await compile(compiler); expect(stats.compilation.emittedAssets.size).toBe(5); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); - expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); + expect(getErrors(stats)).toMatchSnapshot("errors"); await new Promise(async (resolve) => { const newStats = await compile(compiler); expect(newStats.compilation.emittedAssets.size).toBe(5); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getWarnings(newStats)).toMatchSnapshot('errors'); - expect(getErrors(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getWarnings(newStats)).toMatchSnapshot("errors"); + expect(getErrors(newStats)).toMatchSnapshot("warnings"); resolve(); }); diff --git a/test/__snapshots__/test-option.test.js.snap b/test/__snapshots__/test-option.test.js.snap index 654d65b7..1f1ab68d 100644 --- a/test/__snapshots__/test-option.test.js.snap +++ b/test/__snapshots__/test-option.test.js.snap @@ -2,11 +2,11 @@ exports[`test option should match snapshot and uglify "mjs": assets 1`] = ` Object { - "598.598.mjs?ver=d71c535eac1cbd60f5c4": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", - "AsyncImportExport.mjs?var=d71c535eac1cbd60f5c4": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".mjs?ver=\\"+n.h(),n.h=()=>\\"d71c535eac1cbd60f5c4\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,c;if(void 0!==a)for(var l=document.getElementsByTagName(\\"script\\"),u=0;u{i.onerror=i.onload=null,clearTimeout(d);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach((e=>e(o))),r)return r(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),c&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>{o=e[r]=[t,n]}));t.push(o[2]=a);var i=n.p+n.u(r),c=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=a,c.request=i,o[1](c)}}),\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,c,l]=r,u=0,s=[];u{console.log(\\"Good\\")}))})();", - "importExport.mjs?var=d71c535eac1cbd60f5c4": "(()=>{\\"use strict\\";function o(){const o=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+o,b:\\"foo\\",baz:o})}console.log(o())})();", - "js.mjs?var=d71c535eac1cbd60f5c4": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", - "mjs.mjs?var=d71c535eac1cbd60f5c4": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", + "598.598.mjs?ver=7917b5bf8943de3d339b": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "AsyncImportExport.mjs?var=7917b5bf8943de3d339b": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".mjs?ver=\\"+n.h(),n.h=()=>\\"7917b5bf8943de3d339b\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i)=>{if(e[t])e[t].push(o);else{var a,l;if(void 0!==i)for(var u=document.getElementsByTagName(\\"script\\"),c=0;c{a.onerror=a.onload=null,clearTimeout(d);var n=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),r)return r(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>{o=e[r]=[t,n]}));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,i,[a,l,u]=r,c=0,s=[];c{console.log(\\"Good\\")}))})();", + "importExport.mjs?var=7917b5bf8943de3d339b": "(()=>{\\"use strict\\";function o(){const o=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+o,b:\\"foo\\",baz:o})}console.log(o())})();", + "js.mjs?var=7917b5bf8943de3d339b": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.mjs?var=7917b5bf8943de3d339b": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", } `; @@ -16,7 +16,7 @@ exports[`test option should match snapshot and uglify "mjs": warnings 1`] = `Arr exports[`test option should match snapshot for a single "test" value ({String}): assets 1`] = ` Object { - "598.598.js?ver=65ca53d41f635f4ff028": "(self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ + "598.598.js?ver=c81c1863d3c77d23149f": "(self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ /***/ 598: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { @@ -32,7 +32,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }) }]);", - "AsyncImportExport.js?var=65ca53d41f635f4ff028": "/******/ (() => { // webpackBootstrap + "AsyncImportExport.js?var=c81c1863d3c77d23149f": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; /******/ var __webpack_modules__ = ({}); /************************************************************************/ @@ -99,7 +99,7 @@ __webpack_require__.r(__webpack_exports__); /******/ /******/ /* webpack/runtime/getFullHash */ /******/ (() => { -/******/ __webpack_require__.h = () => \\"65ca53d41f635f4ff028\\" +/******/ __webpack_require__.h = () => \\"c81c1863d3c77d23149f\\" /******/ })(); /******/ /******/ /* webpack/runtime/global */ @@ -299,7 +299,7 @@ __webpack_require__.e(/* import() */ 598).then(__webpack_require__.bind(__webpac /******/ })() ;", - "importExport.js?var=65ca53d41f635f4ff028": "/******/ (() => { // webpackBootstrap + "importExport.js?var=c81c1863d3c77d23149f": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; // UNUSED EXPORTS: default @@ -309,7 +309,7 @@ const bar = 'bar'; /* harmony default export */ const dep = ('foo'); // CONCATENATED MODULE: ./test/fixtures/import-export/entry.js - +; function Foo() { const b = dep; @@ -329,8 +329,8 @@ console.log(Foo()); /******/ })() ;", - "js.js?var=65ca53d41f635f4ff028": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", - "mjs.js?var=65ca53d41f635f4ff028": "/******/ (() => { // webpackBootstrap + "js.js?var=c81c1863d3c77d23149f": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.js?var=c81c1863d3c77d23149f": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; // foo // bar @@ -356,7 +356,7 @@ exports[`test option should match snapshot for a single "test" value ({String}): exports[`test option should match snapshot for a single \`test\` value ({RegExp}): assets 1`] = ` Object { - "598.598.js?ver=65ca53d41f635f4ff028": "(self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ + "598.598.js?ver=c81c1863d3c77d23149f": "(self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ /***/ 598: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { @@ -372,7 +372,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }) }]);", - "AsyncImportExport.js?var=65ca53d41f635f4ff028": "/******/ (() => { // webpackBootstrap + "AsyncImportExport.js?var=c81c1863d3c77d23149f": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; /******/ var __webpack_modules__ = ({}); /************************************************************************/ @@ -439,7 +439,7 @@ __webpack_require__.r(__webpack_exports__); /******/ /******/ /* webpack/runtime/getFullHash */ /******/ (() => { -/******/ __webpack_require__.h = () => \\"65ca53d41f635f4ff028\\" +/******/ __webpack_require__.h = () => \\"c81c1863d3c77d23149f\\" /******/ })(); /******/ /******/ /* webpack/runtime/global */ @@ -639,7 +639,7 @@ __webpack_require__.e(/* import() */ 598).then(__webpack_require__.bind(__webpac /******/ })() ;", - "importExport.js?var=65ca53d41f635f4ff028": "/******/ (() => { // webpackBootstrap + "importExport.js?var=c81c1863d3c77d23149f": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; // UNUSED EXPORTS: default @@ -649,7 +649,7 @@ const bar = 'bar'; /* harmony default export */ const dep = ('foo'); // CONCATENATED MODULE: ./test/fixtures/import-export/entry.js - +; function Foo() { const b = dep; @@ -669,8 +669,8 @@ console.log(Foo()); /******/ })() ;", - "js.js?var=65ca53d41f635f4ff028": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", - "mjs.js?var=65ca53d41f635f4ff028": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", + "js.js?var=c81c1863d3c77d23149f": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.js?var=c81c1863d3c77d23149f": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", } `; @@ -680,7 +680,7 @@ exports[`test option should match snapshot for a single \`test\` value ({RegExp} exports[`test option should match snapshot for multiple "test" values ({RegExp}): assets 1`] = ` Object { - "598.598.js?ver=65ca53d41f635f4ff028": "(self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ + "598.598.js?ver=c81c1863d3c77d23149f": "(self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ /***/ 598: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { @@ -696,8 +696,8 @@ __webpack_require__.r(__webpack_exports__); /***/ }) }]);", - "AsyncImportExport.js?var=65ca53d41f635f4ff028": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"65ca53d41f635f4ff028\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),c=0;c{i.onerror=i.onload=null,clearTimeout(d);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach((e=>e(o))),r)return r(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>{o=e[r]=[t,n]}));t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}}),\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,c=0,s=[];c{console.log(\\"Good\\")}))})();", - "importExport.js?var=65ca53d41f635f4ff028": "/******/ (() => { // webpackBootstrap + "AsyncImportExport.js?var=c81c1863d3c77d23149f": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"c81c1863d3c77d23149f\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i)=>{if(e[t])e[t].push(o);else{var a,c;if(void 0!==i)for(var l=document.getElementsByTagName(\\"script\\"),u=0;u{a.onerror=a.onload=null,clearTimeout(d);var n=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),r)return r(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),c&&document.head.appendChild(a)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>{o=e[r]=[t,n]}));t.push(o[2]=i);var a=n.p+n.u(r),c=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",c.name=\\"ChunkLoadError\\",c.type=i,c.request=a,o[1](c)}}),\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,i,[a,c,l]=r,u=0,s=[];u{console.log(\\"Good\\")}))})();", + "importExport.js?var=c81c1863d3c77d23149f": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; // UNUSED EXPORTS: default @@ -707,7 +707,7 @@ const bar = 'bar'; /* harmony default export */ const dep = ('foo'); // CONCATENATED MODULE: ./test/fixtures/import-export/entry.js - +; function Foo() { const b = dep; @@ -727,8 +727,8 @@ console.log(Foo()); /******/ })() ;", - "js.js?var=65ca53d41f635f4ff028": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", - "mjs.js?var=65ca53d41f635f4ff028": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", + "js.js?var=c81c1863d3c77d23149f": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.js?var=c81c1863d3c77d23149f": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", } `; @@ -738,7 +738,7 @@ exports[`test option should match snapshot for multiple "test" values ({RegExp}) exports[`test option should match snapshot for multiple "test" values ({String}): assets 1`] = ` Object { - "598.598.js?ver=65ca53d41f635f4ff028": "(self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ + "598.598.js?ver=c81c1863d3c77d23149f": "(self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ /***/ 598: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { @@ -754,8 +754,8 @@ __webpack_require__.r(__webpack_exports__); /***/ }) }]);", - "AsyncImportExport.js?var=65ca53d41f635f4ff028": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"65ca53d41f635f4ff028\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),c=0;c{i.onerror=i.onload=null,clearTimeout(d);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach((e=>e(o))),r)return r(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>{o=e[r]=[t,n]}));t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}}),\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,c=0,s=[];c{console.log(\\"Good\\")}))})();", - "importExport.js?var=65ca53d41f635f4ff028": "/******/ (() => { // webpackBootstrap + "AsyncImportExport.js?var=c81c1863d3c77d23149f": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"c81c1863d3c77d23149f\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i)=>{if(e[t])e[t].push(o);else{var a,c;if(void 0!==i)for(var l=document.getElementsByTagName(\\"script\\"),u=0;u{a.onerror=a.onload=null,clearTimeout(d);var n=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),r)return r(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),c&&document.head.appendChild(a)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>{o=e[r]=[t,n]}));t.push(o[2]=i);var a=n.p+n.u(r),c=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",c.name=\\"ChunkLoadError\\",c.type=i,c.request=a,o[1](c)}}),\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,i,[a,c,l]=r,u=0,s=[];u{console.log(\\"Good\\")}))})();", + "importExport.js?var=c81c1863d3c77d23149f": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; // UNUSED EXPORTS: default @@ -765,7 +765,7 @@ const bar = 'bar'; /* harmony default export */ const dep = ('foo'); // CONCATENATED MODULE: ./test/fixtures/import-export/entry.js - +; function Foo() { const b = dep; @@ -785,8 +785,8 @@ console.log(Foo()); /******/ })() ;", - "js.js?var=65ca53d41f635f4ff028": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", - "mjs.js?var=65ca53d41f635f4ff028": "/******/ (() => { // webpackBootstrap + "js.js?var=c81c1863d3c77d23149f": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.js?var=c81c1863d3c77d23149f": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; // foo // bar @@ -812,11 +812,11 @@ exports[`test option should match snapshot for multiple "test" values ({String}) exports[`test option should match snapshot with empty value: assets 1`] = ` Object { - "598.598.js?ver=65ca53d41f635f4ff028": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", - "AsyncImportExport.js?var=65ca53d41f635f4ff028": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"65ca53d41f635f4ff028\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a)=>{if(e[t])e[t].push(o);else{var i,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),c=0;c{i.onerror=i.onload=null,clearTimeout(d);var n=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach((e=>e(o))),r)return r(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>{o=e[r]=[t,n]}));t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}}),\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,a,[i,l,u]=r,c=0,s=[];c{console.log(\\"Good\\")}))})();", - "importExport.js?var=65ca53d41f635f4ff028": "(()=>{\\"use strict\\";function o(){const o=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+o,b:\\"foo\\",baz:o})}console.log(o())})();", - "js.js?var=65ca53d41f635f4ff028": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", - "mjs.js?var=65ca53d41f635f4ff028": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", + "598.598.js?ver=c81c1863d3c77d23149f": "(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{\\"use strict\\";p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "AsyncImportExport.js?var=c81c1863d3c77d23149f": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){if(o[e])return o[e].exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"c81c1863d3c77d23149f\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i)=>{if(e[t])e[t].push(o);else{var a,c;if(void 0!==i)for(var l=document.getElementsByTagName(\\"script\\"),u=0;u{a.onerror=a.onload=null,clearTimeout(d);var n=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),r)return r(o)},d=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),c&&document.head.appendChild(a)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>{o=e[r]=[t,n]}));t.push(o[2]=i);var a=n.p+n.u(r),c=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",c.name=\\"ChunkLoadError\\",c.type=i,c.request=a,o[1](c)}}),\\"chunk-\\"+r)}};var r=self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[],t=r.push.bind(r);r.push=r=>{for(var o,i,[a,c,l]=r,u=0,s=[];u{console.log(\\"Good\\")}))})();", + "importExport.js?var=c81c1863d3c77d23149f": "(()=>{\\"use strict\\";function o(){const o=\\"baz\\"+Math.random();return()=>({a:\\"foobar\\"+o,b:\\"foo\\",baz:o})}console.log(o())})();", + "js.js?var=c81c1863d3c77d23149f": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};!function t(e){if(o[e])return o[e].exports;var n=o[e]={exports:{}};return r[e](n,n.exports,t),n.exports}(791)})();", + "mjs.js?var=c81c1863d3c77d23149f": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", } `; diff --git a/test/cache-option.test.js b/test/cache-option.test.js index 3a40c301..d2c12f1c 100644 --- a/test/cache-option.test.js +++ b/test/cache-option.test.js @@ -1,8 +1,8 @@ -import path from 'path'; +import path from "path"; -import del from 'del'; +import del from "del"; -import TerserPlugin from '../src/index'; +import TerserPlugin from "../src/index"; import { compile, @@ -10,26 +10,26 @@ import { getErrors, getWarnings, readsAssets, -} from './helpers'; +} from "./helpers"; jest.setTimeout(30000); describe('"cache" option', () => { const fileSystemCacheDirectory = path.resolve( __dirname, - './outputs/type-filesystem' + "./outputs/type-filesystem" ); const fileSystemCacheDirectory1 = path.resolve( __dirname, - './outputs/type-filesystem-1' + "./outputs/type-filesystem-1" ); const fileSystemCacheDirectory2 = path.resolve( __dirname, - './outputs/type-filesystem-2' + "./outputs/type-filesystem-2" ); const fileSystemCacheDirectory3 = path.resolve( __dirname, - './outputs/type-filesystem-3' + "./outputs/type-filesystem-3" ); beforeAll(() => { @@ -44,11 +44,11 @@ describe('"cache" option', () => { it('should work with "false" value for the "cache" option', async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/cache.js'), - two: path.resolve(__dirname, './fixtures/cache-1.js'), - three: path.resolve(__dirname, './fixtures/cache-2.js'), - four: path.resolve(__dirname, './fixtures/cache-3.js'), - five: path.resolve(__dirname, './fixtures/cache-4.js'), + one: path.resolve(__dirname, "./fixtures/cache.js"), + two: path.resolve(__dirname, "./fixtures/cache-1.js"), + three: path.resolve(__dirname, "./fixtures/cache-2.js"), + four: path.resolve(__dirname, "./fixtures/cache-3.js"), + five: path.resolve(__dirname, "./fixtures/cache-4.js"), }, cache: false, }); @@ -58,9 +58,9 @@ describe('"cache" option', () => { let getCounter = 0; compiler.cache.hooks.get.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { getCounter += 1; } } @@ -69,9 +69,9 @@ describe('"cache" option', () => { let storeCounter = 0; compiler.cache.hooks.store.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { storeCounter += 1; } } @@ -83,9 +83,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(5); // Without cache webpack always try to store expect(storeCounter).toBe(5); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); getCounter = 0; storeCounter = 0; @@ -96,9 +96,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(5); // Without cache webpack always try to store expect(storeCounter).toBe(5); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getErrors(newStats)).toMatchSnapshot('errors'); - expect(getWarnings(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getErrors(newStats)).toMatchSnapshot("errors"); + expect(getWarnings(newStats)).toMatchSnapshot("warnings"); await new Promise((resolve) => { compiler.close(() => { @@ -110,14 +110,14 @@ describe('"cache" option', () => { it('should work with "memory" value for the "cache.type" option', async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/cache.js'), - two: path.resolve(__dirname, './fixtures/cache-1.js'), - three: path.resolve(__dirname, './fixtures/cache-2.js'), - four: path.resolve(__dirname, './fixtures/cache-3.js'), - five: path.resolve(__dirname, './fixtures/cache-4.js'), + one: path.resolve(__dirname, "./fixtures/cache.js"), + two: path.resolve(__dirname, "./fixtures/cache-1.js"), + three: path.resolve(__dirname, "./fixtures/cache-2.js"), + four: path.resolve(__dirname, "./fixtures/cache-3.js"), + five: path.resolve(__dirname, "./fixtures/cache-4.js"), }, cache: { - type: 'memory', + type: "memory", }, }); @@ -126,9 +126,9 @@ describe('"cache" option', () => { let getCounter = 0; compiler.cache.hooks.get.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { getCounter += 1; } } @@ -137,9 +137,9 @@ describe('"cache" option', () => { let storeCounter = 0; compiler.cache.hooks.store.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { storeCounter += 1; } } @@ -151,9 +151,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(5); // Store cached assets expect(storeCounter).toBe(5); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); getCounter = 0; storeCounter = 0; @@ -164,9 +164,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(5); // No need to store, we got cached assets expect(storeCounter).toBe(0); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getErrors(newStats)).toMatchSnapshot('errors'); - expect(getWarnings(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getErrors(newStats)).toMatchSnapshot("errors"); + expect(getWarnings(newStats)).toMatchSnapshot("warnings"); await new Promise((resolve) => { compiler.close(() => { @@ -178,14 +178,14 @@ describe('"cache" option', () => { it('should work with "filesystem" value for the "cache.type" option', async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/cache.js'), - two: path.resolve(__dirname, './fixtures/cache-1.js'), - three: path.resolve(__dirname, './fixtures/cache-2.js'), - four: path.resolve(__dirname, './fixtures/cache-3.js'), - five: path.resolve(__dirname, './fixtures/cache-4.js'), + one: path.resolve(__dirname, "./fixtures/cache.js"), + two: path.resolve(__dirname, "./fixtures/cache-1.js"), + three: path.resolve(__dirname, "./fixtures/cache-2.js"), + four: path.resolve(__dirname, "./fixtures/cache-3.js"), + five: path.resolve(__dirname, "./fixtures/cache-4.js"), }, cache: { - type: 'filesystem', + type: "filesystem", cacheDirectory: fileSystemCacheDirectory, }, }); @@ -195,9 +195,9 @@ describe('"cache" option', () => { let getCounter = 0; compiler.cache.hooks.get.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { getCounter += 1; } } @@ -206,9 +206,9 @@ describe('"cache" option', () => { let storeCounter = 0; compiler.cache.hooks.store.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { storeCounter += 1; } } @@ -220,9 +220,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(5); // Store cached assets expect(storeCounter).toBe(5); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); getCounter = 0; storeCounter = 0; @@ -233,9 +233,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(5); // No need to store, we got cached assets expect(storeCounter).toBe(0); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getErrors(newStats)).toMatchSnapshot('errors'); - expect(getWarnings(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getErrors(newStats)).toMatchSnapshot("errors"); + expect(getWarnings(newStats)).toMatchSnapshot("warnings"); await new Promise((resolve) => { compiler.close(() => { @@ -246,16 +246,16 @@ describe('"cache" option', () => { it('should work with "filesystem" value for the "cache.type" option and source maps', async () => { const compiler = getCompiler({ - devtool: 'source-map', + devtool: "source-map", entry: { - one: path.resolve(__dirname, './fixtures/cache.js'), - two: path.resolve(__dirname, './fixtures/cache-1.js'), - three: path.resolve(__dirname, './fixtures/cache-2.js'), - four: path.resolve(__dirname, './fixtures/cache-3.js'), - five: path.resolve(__dirname, './fixtures/cache-4.js'), + one: path.resolve(__dirname, "./fixtures/cache.js"), + two: path.resolve(__dirname, "./fixtures/cache-1.js"), + three: path.resolve(__dirname, "./fixtures/cache-2.js"), + four: path.resolve(__dirname, "./fixtures/cache-3.js"), + five: path.resolve(__dirname, "./fixtures/cache-4.js"), }, cache: { - type: 'filesystem', + type: "filesystem", cacheDirectory: fileSystemCacheDirectory1, }, }); @@ -265,9 +265,9 @@ describe('"cache" option', () => { let getCounter = 0; compiler.cache.hooks.get.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { getCounter += 1; } } @@ -276,9 +276,9 @@ describe('"cache" option', () => { let storeCounter = 0; compiler.cache.hooks.store.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { storeCounter += 1; } } @@ -290,9 +290,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(5); // Store cached assets expect(storeCounter).toBe(5); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); getCounter = 0; storeCounter = 0; @@ -303,9 +303,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(5); // No need to store, we got cached assets expect(storeCounter).toBe(0); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getErrors(newStats)).toMatchSnapshot('errors'); - expect(getWarnings(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getErrors(newStats)).toMatchSnapshot("errors"); + expect(getWarnings(newStats)).toMatchSnapshot("warnings"); await new Promise((resolve) => { compiler.close(() => { @@ -317,13 +317,13 @@ describe('"cache" option', () => { it('should work with "filesystem" value for the "cache.type" option and extract comments in different files', async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), - two: path.resolve(__dirname, './fixtures/comments-2.js'), - three: path.resolve(__dirname, './fixtures/comments-3.js'), - four: path.resolve(__dirname, './fixtures/comments-4.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), + two: path.resolve(__dirname, "./fixtures/comments-2.js"), + three: path.resolve(__dirname, "./fixtures/comments-3.js"), + four: path.resolve(__dirname, "./fixtures/comments-4.js"), }, cache: { - type: 'filesystem', + type: "filesystem", cacheDirectory: fileSystemCacheDirectory2, }, }); @@ -333,9 +333,9 @@ describe('"cache" option', () => { let getCounter = 0; compiler.cache.hooks.get.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { getCounter += 1; } } @@ -344,9 +344,9 @@ describe('"cache" option', () => { let storeCounter = 0; compiler.cache.hooks.store.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { storeCounter += 1; } } @@ -358,9 +358,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(5); // Store cached assets expect(storeCounter).toBe(5); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); getCounter = 0; storeCounter = 0; @@ -371,9 +371,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(5); // No need to store, we got cached assets expect(storeCounter).toBe(0); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getErrors(newStats)).toMatchSnapshot('errors'); - expect(getWarnings(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getErrors(newStats)).toMatchSnapshot("errors"); + expect(getWarnings(newStats)).toMatchSnapshot("warnings"); await new Promise((resolve) => { compiler.close(() => { @@ -385,29 +385,29 @@ describe('"cache" option', () => { it('should work with "filesystem" value for the "cache.type" option and extract comments in the one file', async () => { const compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), - two: path.resolve(__dirname, './fixtures/comments-2.js'), - three: path.resolve(__dirname, './fixtures/comments-3.js'), - four: path.resolve(__dirname, './fixtures/comments-4.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), + two: path.resolve(__dirname, "./fixtures/comments-2.js"), + three: path.resolve(__dirname, "./fixtures/comments-3.js"), + four: path.resolve(__dirname, "./fixtures/comments-4.js"), }, cache: { - type: 'filesystem', + type: "filesystem", cacheDirectory: fileSystemCacheDirectory3, }, }); new TerserPlugin({ extractComments: { - filename: 'licenses.txt', + filename: "licenses.txt", }, }).apply(compiler); let getCounter = 0; compiler.cache.hooks.get.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { getCounter += 1; } } @@ -416,9 +416,9 @@ describe('"cache" option', () => { let storeCounter = 0; compiler.cache.hooks.store.tap( - { name: 'TestCache', stage: -100 }, + { name: "TestCache", stage: -100 }, (identifier) => { - if (identifier.indexOf('TerserWebpackPlugin') !== -1) { + if (identifier.indexOf("TerserWebpackPlugin") !== -1) { storeCounter += 1; } } @@ -430,9 +430,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(9); // Store cached assets expect(storeCounter).toBe(9); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); getCounter = 0; storeCounter = 0; @@ -443,9 +443,9 @@ describe('"cache" option', () => { expect(getCounter).toBe(9); // No need to store, we got cached assets expect(storeCounter).toBe(0); - expect(readsAssets(compiler, newStats)).toMatchSnapshot('assets'); - expect(getErrors(newStats)).toMatchSnapshot('errors'); - expect(getWarnings(newStats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, newStats)).toMatchSnapshot("assets"); + expect(getErrors(newStats)).toMatchSnapshot("errors"); + expect(getWarnings(newStats)).toMatchSnapshot("warnings"); await new Promise((resolve) => { compiler.close(() => { diff --git a/test/cjs.test.js b/test/cjs.test.js index 3893b518..06cab739 100644 --- a/test/cjs.test.js +++ b/test/cjs.test.js @@ -1,8 +1,8 @@ -import src from '../src'; -import cjs from '../src/cjs'; +import src from "../src"; +import cjs from "../src/cjs"; -describe('CJS', () => { - it('should export loader', () => { +describe("CJS", () => { + it("should export loader", () => { expect(cjs).toEqual(src); }); }); diff --git a/test/exclude-option.test.js b/test/exclude-option.test.js index b301e3a5..c4137009 100644 --- a/test/exclude-option.test.js +++ b/test/exclude-option.test.js @@ -1,6 +1,6 @@ -import path from 'path'; +import path from "path"; -import TerserPlugin from '../src/index'; +import TerserPlugin from "../src/index"; import { compile, @@ -8,66 +8,66 @@ import { getErrors, getWarnings, readsAssets, -} from './helpers'; +} from "./helpers"; -describe('exclude option', () => { +describe("exclude option", () => { let compiler; beforeEach(() => { compiler = getCompiler({ entry: { - excluded1: path.resolve(__dirname, './fixtures/excluded1.js'), - excluded2: path.resolve(__dirname, './fixtures/excluded2.js'), - entry: path.resolve(__dirname, './fixtures/entry.js'), + excluded1: path.resolve(__dirname, "./fixtures/excluded1.js"), + excluded2: path.resolve(__dirname, "./fixtures/excluded2.js"), + entry: path.resolve(__dirname, "./fixtures/entry.js"), }, }); }); - it('should match snapshot for a single RegExp value', async () => { + it("should match snapshot for a single RegExp value", async () => { new TerserPlugin({ exclude: /excluded1/i, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for a single String value', async () => { + it("should match snapshot for a single String value", async () => { new TerserPlugin({ - exclude: 'excluded1', + exclude: "excluded1", }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for multiple RegExp values', async () => { + it("should match snapshot for multiple RegExp values", async () => { new TerserPlugin({ exclude: [/excluded1/i, /excluded2/i], }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for multiple String values', async () => { + it("should match snapshot for multiple String values", async () => { new TerserPlugin({ - exclude: ['excluded1', 'excluded2'], + exclude: ["excluded1", "excluded2"], }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); diff --git a/test/extractComments-option.test.js b/test/extractComments-option.test.js index 15588225..90e53030 100644 --- a/test/extractComments-option.test.js +++ b/test/extractComments-option.test.js @@ -1,8 +1,8 @@ -import path from 'path'; +import path from "path"; -import webpack from 'webpack'; +import webpack from "webpack"; -import TerserPlugin from '../src/index'; +import TerserPlugin from "../src/index"; import { compile, @@ -11,7 +11,7 @@ import { getWarnings, readsAssets, ExistingCommentsFile, -} from './helpers'; +} from "./helpers"; function createFilenameFn() { return (fileData) => { @@ -23,32 +23,32 @@ function createFilenameFn() { }; } -describe('extractComments option', () => { +describe("extractComments option", () => { let compiler; beforeEach(() => { compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), - two: path.resolve(__dirname, './fixtures/comments-2.js'), - three: path.resolve(__dirname, './fixtures/comments-3.js'), - four: path.resolve(__dirname, './fixtures/comments-4.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), + two: path.resolve(__dirname, "./fixtures/comments-2.js"), + three: path.resolve(__dirname, "./fixtures/comments-3.js"), + four: path.resolve(__dirname, "./fixtures/comments-4.js"), }, output: { - filename: 'filename/[name].js', - chunkFilename: 'chunks/[id].[name].js', + filename: "filename/[name].js", + chunkFilename: "chunks/[id].[name].js", }, }); }); - it('should match snapshot when a value is not specify', async () => { + it("should match snapshot when a value is not specify", async () => { new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "false" value', async () => { @@ -56,9 +56,9 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "true" value', async () => { @@ -66,9 +66,9 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "/Foo/" value', async () => { @@ -76,39 +76,39 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "all" value', async () => { - new TerserPlugin({ extractComments: 'all' }).apply(compiler); + new TerserPlugin({ extractComments: "all" }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "some" value', async () => { - new TerserPlugin({ extractComments: 'some' }).apply(compiler); + new TerserPlugin({ extractComments: "some" }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "Foo" value', async () => { - new TerserPlugin({ extractComments: 'Foo' }).apply(compiler); + new TerserPlugin({ extractComments: "Foo" }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for a "function" value', async () => { @@ -116,9 +116,9 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "extractComments.condition" with the "true" value', async () => { @@ -130,12 +130,12 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot when extracts comments to multiple files', async () => { + it("should match snapshot when extracts comments to multiple files", async () => { expect.assertions(8); new TerserPlugin({ @@ -150,16 +150,16 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot when extracts comments to a single file', async () => { + it("should match snapshot when extracts comments to a single file", async () => { new TerserPlugin({ extractComments: { condition: true, - filename: 'extracted-comments.js', + filename: "extracted-comments.js", banner(licenseFile) { return `License information can be found in ${licenseFile}`; }, @@ -168,16 +168,16 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot when extracts without condition', async () => { + it("should match snapshot when extracts without condition", async () => { new TerserPlugin({ extractComments: { condition: true, - filename: 'extracted-comments.js', + filename: "extracted-comments.js", banner(licenseFile) { return `License information can be found in ${licenseFile}`; }, @@ -186,9 +186,9 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the `true` value and preserve "@license" comments', async () => { @@ -203,9 +203,9 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot when no condition, preserve only `/@license/i` comments and extract "some" comments', async () => { @@ -227,26 +227,26 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for the `true` value and dedupe duplicate comments', async () => { + it("should match snapshot for the `true` value and dedupe duplicate comments", async () => { new TerserPlugin({ extractComments: true }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot when extracts comments to a single file and dedupe duplicate comments', async () => { + it("should match snapshot when extracts comments to a single file and dedupe duplicate comments", async () => { new TerserPlugin({ extractComments: { condition: true, - filename: 'extracted-comments.js', + filename: "extracted-comments.js", banner(licenseFile) { return `License information can be found in ${licenseFile}`; }, @@ -255,22 +255,22 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot when extracts comments to files with query string', async () => { + it("should match snapshot when extracts comments to files with query string", async () => { compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), - two: path.resolve(__dirname, './fixtures/comments-2.js'), - three: path.resolve(__dirname, './fixtures/comments-3.js'), - four: path.resolve(__dirname, './fixtures/comments-4.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), + two: path.resolve(__dirname, "./fixtures/comments-2.js"), + three: path.resolve(__dirname, "./fixtures/comments-3.js"), + four: path.resolve(__dirname, "./fixtures/comments-4.js"), }, output: { - filename: 'filename/[name].js?[chunkhash]', - chunkFilename: 'chunks/[id].[name].js?[chunkhash]', + filename: "filename/[name].js?[chunkhash]", + chunkFilename: "chunks/[id].[name].js?[chunkhash]", }, }); @@ -278,22 +278,22 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot when extracts comments to files with query string and with placeholders', async () => { + it("should match snapshot when extracts comments to files with query string and with placeholders", async () => { compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), - two: path.resolve(__dirname, './fixtures/comments-2.js'), - three: path.resolve(__dirname, './fixtures/comments-3.js'), - four: path.resolve(__dirname, './fixtures/comments-4.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), + two: path.resolve(__dirname, "./fixtures/comments-2.js"), + three: path.resolve(__dirname, "./fixtures/comments-3.js"), + four: path.resolve(__dirname, "./fixtures/comments-4.js"), }, output: { - filename: 'filename/[name].js?[chunkhash]', - chunkFilename: 'chunks/[id].[name].js?[chunkhash]', + filename: "filename/[name].js?[chunkhash]", + chunkFilename: "chunks/[id].[name].js?[chunkhash]", }, }); @@ -309,24 +309,24 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot when extracts comments to files with query string and when filename is a function', async () => { + it("should match snapshot when extracts comments to files with query string and when filename is a function", async () => { expect.assertions(8); compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), - two: path.resolve(__dirname, './fixtures/comments-2.js'), - three: path.resolve(__dirname, './fixtures/comments-3.js'), - four: path.resolve(__dirname, './fixtures/comments-4.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), + two: path.resolve(__dirname, "./fixtures/comments-2.js"), + three: path.resolve(__dirname, "./fixtures/comments-3.js"), + four: path.resolve(__dirname, "./fixtures/comments-4.js"), }, output: { - filename: 'filename/[name].js?[chunkhash]', - chunkFilename: 'chunks/[id].[name].js?[chunkhash]', + filename: "filename/[name].js?[chunkhash]", + chunkFilename: "chunks/[id].[name].js?[chunkhash]", }, }); @@ -339,54 +339,54 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for nested comment file', async () => { + it("should match snapshot for nested comment file", async () => { compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), }, }); new TerserPlugin({ extractComments: { condition: true, - filename: 'comments/directory/one.js', + filename: "comments/directory/one.js", }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for comment file when filename is nested', async () => { + it("should match snapshot for comment file when filename is nested", async () => { compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/comments.js'), + one: path.resolve(__dirname, "./fixtures/comments.js"), }, output: { - filename: 'nested/directory/[name].js?[chunkhash]', + filename: "nested/directory/[name].js?[chunkhash]", }, }); new TerserPlugin({ extractComments: { condition: true, - filename: 'one.js', + filename: "one.js", }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and extract "some" comments', async () => { @@ -396,9 +396,9 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and preserve "all" and extract "some" comments', async () => { @@ -406,45 +406,45 @@ describe('extractComments option', () => { extractComments: true, terserOptions: { output: { - comments: 'all', + comments: "all", }, }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and do not preserve and extract "all" comments', async () => { new TerserPlugin({ - extractComments: 'all', + extractComments: "all", }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and preserve "all" and extract "all" comments', async () => { new TerserPlugin({ - extractComments: 'all', + extractComments: "all", terserOptions: { output: { - comments: 'all', + comments: "all", }, }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and do not preserve and extract "all" comments', async () => { @@ -454,9 +454,9 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and preserve "all" and extract "all" comments', async () => { @@ -464,16 +464,16 @@ describe('extractComments option', () => { extractComments: () => true, terserOptions: { output: { - comments: 'all', + comments: "all", }, }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and do not preserve and extract "some" comments', async () => { @@ -483,9 +483,9 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and preserve "all" and extract "some" comments', async () => { @@ -493,35 +493,35 @@ describe('extractComments option', () => { extractComments: {}, terserOptions: { output: { - comments: 'all', + comments: "all", }, }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and preserve "all" and extract "some" comments', async () => { new TerserPlugin({ extractComments: { - condition: 'some', + condition: "some", }, terserOptions: { output: { - comments: 'all', + comments: "all", }, }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and preserve "all" and do not extract comments', async () => { @@ -531,16 +531,16 @@ describe('extractComments option', () => { }, terserOptions: { output: { - comments: 'all', + comments: "all", }, }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and preserve "some" do not extract comments', async () => { @@ -550,9 +550,9 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and preserve "all" do not extract comments', async () => { @@ -560,19 +560,19 @@ describe('extractComments option', () => { extractComments: false, terserOptions: { output: { - comments: 'all', + comments: "all", }, }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot and do not preserve or extract comments', async () => { + it("should match snapshot and do not preserve or extract comments", async () => { new TerserPlugin({ extractComments: false, terserOptions: { @@ -584,20 +584,20 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot and keep shebang', async () => { + it("should match snapshot and keep shebang", async () => { compiler = getCompiler({ entry: { - shebang: path.resolve(__dirname, './fixtures/shebang.js'), - shebang1: path.resolve(__dirname, './fixtures/shebang-1.js'), + shebang: path.resolve(__dirname, "./fixtures/shebang.js"), + shebang1: path.resolve(__dirname, "./fixtures/shebang-1.js"), }, - target: 'node', + target: "node", plugins: [ - new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }), + new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true }), ], }); @@ -605,23 +605,23 @@ describe('extractComments option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should work with the existing licenses file', async () => { + it("should work with the existing licenses file", async () => { new ExistingCommentsFile().apply(compiler); new TerserPlugin({ extractComments: { - filename: 'licenses.txt', + filename: "licenses.txt", }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); diff --git a/test/helpers/BrokenCodePlugin.js b/test/helpers/BrokenCodePlugin.js index c1ef88d3..3224c771 100644 --- a/test/helpers/BrokenCodePlugin.js +++ b/test/helpers/BrokenCodePlugin.js @@ -1,4 +1,4 @@ -import webpack from 'webpack'; +import webpack from "webpack"; export default class BrokenCodePlugin { apply(compiler) { @@ -7,8 +7,8 @@ export default class BrokenCodePlugin { compiler.hooks.thisCompilation.tap(plugin, (compilation) => { compilation.hooks.additionalAssets.tap(plugin, () => { // eslint-disable-next-line no-param-reassign - compilation.assets['broken.js'] = new webpack.sources.RawSource( - '`Broken===' + compilation.assets["broken.js"] = new webpack.sources.RawSource( + "`Broken===" ); }); }); diff --git a/test/helpers/ExistingCommentsFile.js b/test/helpers/ExistingCommentsFile.js index 77159dfc..e88ed615 100644 --- a/test/helpers/ExistingCommentsFile.js +++ b/test/helpers/ExistingCommentsFile.js @@ -1,4 +1,4 @@ -import webpack from 'webpack'; +import webpack from "webpack"; export default class ExistingCommentsFile { apply(compiler) { @@ -7,8 +7,8 @@ export default class ExistingCommentsFile { compiler.hooks.thisCompilation.tap(plugin, (compilation) => { compilation.hooks.additionalAssets.tap(plugin, () => { // eslint-disable-next-line no-param-reassign - compilation.assets['licenses.txt'] = new webpack.sources.RawSource( - '// Existing Comment' + compilation.assets["licenses.txt"] = new webpack.sources.RawSource( + "// Existing Comment" ); }); }); diff --git a/test/helpers/ModifyExistingAsset.js b/test/helpers/ModifyExistingAsset.js index 4dfe93d6..21dccc68 100644 --- a/test/helpers/ModifyExistingAsset.js +++ b/test/helpers/ModifyExistingAsset.js @@ -1,4 +1,4 @@ -import webpack from 'webpack'; +import webpack from "webpack"; export default class ExistingCommentsFile { constructor(options = {}) { @@ -15,7 +15,7 @@ export default class ExistingCommentsFile { this.options.name ] = new webpack.sources.ConcatSource( `function changed() {} ${ - this.options.comment ? '/*! CHANGED */' : '' + this.options.comment ? "/*! CHANGED */" : "" }`, compilation.assets[this.options.name] ); diff --git a/test/helpers/execute.js b/test/helpers/execute.js index 866001ae..7e1a94e6 100644 --- a/test/helpers/execute.js +++ b/test/helpers/execute.js @@ -1,14 +1,14 @@ -import Module from 'module'; -import path from 'path'; +import Module from "module"; +import path from "path"; const parentModule = module; export default (code) => { - const resource = 'test.js'; + const resource = "test.js"; const module = new Module(resource, parentModule); // eslint-disable-next-line no-underscore-dangle module.paths = Module._nodeModulePaths( - path.resolve(__dirname, '../fixtures') + path.resolve(__dirname, "../fixtures") ); module.filename = resource; diff --git a/test/helpers/getCompiler.js b/test/helpers/getCompiler.js index 6ac22665..19c31e10 100644 --- a/test/helpers/getCompiler.js +++ b/test/helpers/getCompiler.js @@ -1,24 +1,24 @@ -import path from 'path'; +import path from "path"; -import webpack from 'webpack'; -import { createFsFromVolume, Volume } from 'memfs'; +import webpack from "webpack"; +import { createFsFromVolume, Volume } from "memfs"; export default function getCompiler(options = {}) { const compiler = webpack( Array.isArray(options) ? options : { - mode: 'production', + mode: "production", bail: true, - entry: path.resolve(__dirname, '../fixtures/entry.js'), + entry: path.resolve(__dirname, "../fixtures/entry.js"), optimization: { minimize: false, }, output: { pathinfo: false, - path: path.resolve(__dirname, 'dist'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "dist"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, plugins: [], ...options, diff --git a/test/helpers/getErrors.js b/test/helpers/getErrors.js index 085bae5b..a2f052f9 100644 --- a/test/helpers/getErrors.js +++ b/test/helpers/getErrors.js @@ -1,4 +1,4 @@ -import normalizeErrors from './normalizeErrors'; +import normalizeErrors from "./normalizeErrors"; export default (stats) => { return normalizeErrors(stats.compilation.errors).sort(); diff --git a/test/helpers/getWarnings.js b/test/helpers/getWarnings.js index 9e09c82b..5f173498 100644 --- a/test/helpers/getWarnings.js +++ b/test/helpers/getWarnings.js @@ -1,4 +1,4 @@ -import normalizeErrors from './normalizeErrors'; +import normalizeErrors from "./normalizeErrors"; export default (stats) => { return normalizeErrors(stats.compilation.warnings).sort(); diff --git a/test/helpers/index.js b/test/helpers/index.js index 8f68d123..d9c05d08 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -1,15 +1,15 @@ -import BrokenCodePlugin from './BrokenCodePlugin'; -import compile from './compile'; -import countPlugins from './countPlugins'; -import execute from './execute'; -import ExistingCommentsFile from './ExistingCommentsFile'; -import getCompiler from './getCompiler'; -import getErrors from './getErrors'; -import getWarnings from './getWarnings'; -import ModifyExistingAsset from './ModifyExistingAsset'; -import readAsset from './readAsset'; -import readsAssets from './readAssets'; -import normalizeErrors from './normalizeErrors'; +import BrokenCodePlugin from "./BrokenCodePlugin"; +import compile from "./compile"; +import countPlugins from "./countPlugins"; +import execute from "./execute"; +import ExistingCommentsFile from "./ExistingCommentsFile"; +import getCompiler from "./getCompiler"; +import getErrors from "./getErrors"; +import getWarnings from "./getWarnings"; +import ModifyExistingAsset from "./ModifyExistingAsset"; +import readAsset from "./readAsset"; +import readsAssets from "./readAssets"; +import normalizeErrors from "./normalizeErrors"; export { BrokenCodePlugin, diff --git a/test/helpers/normalizeErrors.js b/test/helpers/normalizeErrors.js index c6d0f160..f1c380e7 100644 --- a/test/helpers/normalizeErrors.js +++ b/test/helpers/normalizeErrors.js @@ -1,19 +1,19 @@ function removeCWD(str) { - const isWin = process.platform === 'win32'; + const isWin = process.platform === "win32"; let cwd = process.cwd(); if (isWin) { // eslint-disable-next-line no-param-reassign - str = str.replace(/\\/g, '/'); + str = str.replace(/\\/g, "/"); // eslint-disable-next-line no-param-reassign - cwd = cwd.replace(/\\/g, '/'); + cwd = cwd.replace(/\\/g, "/"); } - return str.replace(new RegExp(cwd, 'g'), ''); + return str.replace(new RegExp(cwd, "g"), ""); } export default (errors) => { return errors.map((error) => - removeCWD(error.toString().split('\n').slice(0, 2).join('\n')) + removeCWD(error.toString().split("\n").slice(0, 2).join("\n")) ); }; diff --git a/test/helpers/readAsset.js b/test/helpers/readAsset.js index 8f4699f0..fde3ff39 100644 --- a/test/helpers/readAsset.js +++ b/test/helpers/readAsset.js @@ -1,13 +1,13 @@ -import path from 'path'; +import path from "path"; export default (asset, compiler, stats) => { const usedFs = compiler.outputFileSystem; const outputPath = stats.compilation.outputOptions.path; - let data = ''; + let data = ""; let targetFile = asset; - const queryStringIdx = targetFile.indexOf('?'); + const queryStringIdx = targetFile.indexOf("?"); if (queryStringIdx >= 0) { targetFile = targetFile.substr(0, queryStringIdx); diff --git a/test/helpers/readAssets.js b/test/helpers/readAssets.js index a2fb7837..15b9dca2 100644 --- a/test/helpers/readAssets.js +++ b/test/helpers/readAssets.js @@ -1,4 +1,4 @@ -import readAsset from './readAsset'; +import readAsset from "./readAsset"; export default function readAssets(compiler, stats) { const assets = {}; diff --git a/test/helpers/snapshotResolver.js b/test/helpers/snapshotResolver.js index 742ee5b6..4303e7e0 100644 --- a/test/helpers/snapshotResolver.js +++ b/test/helpers/snapshotResolver.js @@ -1,28 +1,28 @@ -const path = require('path'); +const path = require("path"); -const webpack = require('webpack'); +const webpack = require("webpack"); // eslint-disable-next-line global-require const [webpackVersion] = webpack.version; const snapshotExtension = `.snap.webpack${webpackVersion}`; // eslint-disable-next-line no-console -console.log('Current webpack version:', webpackVersion); +console.log("Current webpack version:", webpackVersion); module.exports = { resolveSnapshotPath: (testPath) => path.join( path.dirname(testPath), - '__snapshots__', + "__snapshots__", `${path.basename(testPath)}${snapshotExtension}` ), resolveTestPath: (snapshotPath) => snapshotPath - .replace(`${path.sep}__snapshots__`, '') + .replace(`${path.sep}__snapshots__`, "") .slice(0, -snapshotExtension.length), testPathForConsistencyCheck: path.join( - 'consistency_check', - '__tests__', - 'example.test.js' + "consistency_check", + "__tests__", + "example.test.js" ), }; diff --git a/test/include-option.test.js b/test/include-option.test.js index 0ef1e306..36a4e311 100644 --- a/test/include-option.test.js +++ b/test/include-option.test.js @@ -1,6 +1,6 @@ -import path from 'path'; +import path from "path"; -import TerserPlugin from '../src/index'; +import TerserPlugin from "../src/index"; import { compile, @@ -8,66 +8,66 @@ import { getErrors, getWarnings, readsAssets, -} from './helpers'; +} from "./helpers"; -describe('include option', () => { +describe("include option", () => { let compiler; beforeEach(() => { compiler = getCompiler({ entry: { - included1: path.resolve(__dirname, './fixtures/included1.js'), - included2: path.resolve(__dirname, './fixtures/included2.js'), - entry: path.resolve(__dirname, './fixtures/entry.js'), + included1: path.resolve(__dirname, "./fixtures/included1.js"), + included2: path.resolve(__dirname, "./fixtures/included2.js"), + entry: path.resolve(__dirname, "./fixtures/entry.js"), }, }); }); - it('should match snapshot for a single RegExp value', async () => { + it("should match snapshot for a single RegExp value", async () => { new TerserPlugin({ include: /included1/i, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for a single String value', async () => { + it("should match snapshot for a single String value", async () => { new TerserPlugin({ - include: 'included1', + include: "included1", }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for multiple RegExp values', async () => { + it("should match snapshot for multiple RegExp values", async () => { new TerserPlugin({ include: [/included1/i, /included2/i], }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for multiple String values', async () => { + it("should match snapshot for multiple String values", async () => { new TerserPlugin({ - include: ['included1', 'included2'], + include: ["included1", "included2"], }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); diff --git a/test/minify-option.test.js b/test/minify-option.test.js index 164fd4ab..ee977150 100644 --- a/test/minify-option.test.js +++ b/test/minify-option.test.js @@ -1,6 +1,6 @@ -import path from 'path'; +import path from "path"; -import TerserPlugin from '../src'; +import TerserPlugin from "../src"; import { compile, @@ -8,16 +8,16 @@ import { getErrors, getWarnings, readsAssets, -} from './helpers'; +} from "./helpers"; -describe('minify option', () => { - it('should work', async () => { +describe("minify option", () => { + it("should work", async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/minify/es6.js'), + entry: path.resolve(__dirname, "./fixtures/minify/es6.js"), output: { - path: path.resolve(__dirname, './dist-terser'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-terser"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -25,29 +25,29 @@ describe('minify option', () => { terserOptions: { keep_fnames: true, mangle: { - reserved: ['baz'], + reserved: ["baz"], }, }, minify(file, inputSourceMap, minimizerOptions) { // eslint-disable-next-line global-require - return require('terser').minify(file, minimizerOptions); + return require("terser").minify(file, minimizerOptions); }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should work when the "parallel" option is "true"', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/minify/es6.js'), + entry: path.resolve(__dirname, "./fixtures/minify/es6.js"), output: { - path: path.resolve(__dirname, './dist-terser'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-terser"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -55,24 +55,24 @@ describe('minify option', () => { parallel: true, minify(file, inputSourceMap, minimizerOptions) { // eslint-disable-next-line global-require - return require('terser').minify(file, minimizerOptions); + return require("terser").minify(file, minimizerOptions); }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should work when the "parallel" option is "false"', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/minify/es6.js'), + entry: path.resolve(__dirname, "./fixtures/minify/es6.js"), output: { - path: path.resolve(__dirname, './dist-terser'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-terser"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -80,92 +80,92 @@ describe('minify option', () => { parallel: false, minify(file, inputSourceMap, minimizerOptions) { // eslint-disable-next-line global-require - return require('terser').minify(file, minimizerOptions); + return require("terser").minify(file, minimizerOptions); }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should throw an error when an error', async () => { + it("should throw an error when an error", async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/minify/es6.js'), + entry: path.resolve(__dirname, "./fixtures/minify/es6.js"), output: { - path: path.resolve(__dirname, './dist-terser'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-terser"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); new TerserPlugin({ minify() { - throw Error('Error'); + throw Error("Error"); }, }).apply(compiler); const stats = await compile(compiler); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should throw an error when an error when the "parallel" option is "true"', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/minify/es6.js'), + entry: path.resolve(__dirname, "./fixtures/minify/es6.js"), output: { - path: path.resolve(__dirname, './dist-terser'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-terser"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); new TerserPlugin({ parallel: true, minify: () => { - throw Error('Error'); + throw Error("Error"); }, }).apply(compiler); const stats = await compile(compiler); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should throw an error when an error when the "parallel" option is "false"', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/minify/es6.js'), + entry: path.resolve(__dirname, "./fixtures/minify/es6.js"), output: { - path: path.resolve(__dirname, './dist-terser'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-terser"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); new TerserPlugin({ parallel: false, minify: () => { - throw Error('Error'); + throw Error("Error"); }, }).apply(compiler); const stats = await compile(compiler); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should snapshot with extracting comments', async () => { + it("should snapshot with extracting comments", async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/minify/es5.js'), + entry: path.resolve(__dirname, "./fixtures/minify/es5.js"), output: { - path: path.resolve(__dirname, './dist-uglify-js'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-uglify-js"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -173,31 +173,31 @@ describe('minify option', () => { extractComments: true, async minify(file) { // eslint-disable-next-line global-require - const result = await require('terser').minify(file, { + const result = await require("terser").minify(file, { mangle: { - reserved: ['baz'], + reserved: ["baz"], }, }); - return { ...result, extractedComments: ['/* Foo */'] }; + return { ...result, extractedComments: ["/* Foo */"] }; }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should work with source maps', async () => { + it("should work with source maps", async () => { const compiler = getCompiler({ - devtool: 'source-map', - entry: path.resolve(__dirname, './fixtures/minify/es6.js'), + devtool: "source-map", + entry: path.resolve(__dirname, "./fixtures/minify/es6.js"), output: { - path: path.resolve(__dirname, './dist-terser'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-terser"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); @@ -205,7 +205,7 @@ describe('minify option', () => { minify(file, sourceMap) { const terserOption = { mangle: { - reserved: ['baz'], + reserved: ["baz"], }, }; @@ -216,34 +216,34 @@ describe('minify option', () => { } // eslint-disable-next-line global-require - return require('terser').minify(file, terserOption); + return require("terser").minify(file, terserOption); }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should work with "uglify-js" minimizer', async () => { const compiler = getCompiler({ - target: ['es5', 'web'], - entry: path.resolve(__dirname, './fixtures/minify/es5.js'), + target: ["es5", "web"], + entry: path.resolve(__dirname, "./fixtures/minify/es5.js"), output: { - path: path.resolve(__dirname, './dist-uglify-js'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-uglify-js"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); new TerserPlugin({ minify(file) { // eslint-disable-next-line global-require - return require('uglify-js').minify(file, { + return require("uglify-js").minify(file, { mangle: { - reserved: ['baz'], + reserved: ["baz"], }, }); }, @@ -251,27 +251,27 @@ describe('minify option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should work with "terser" minimizer', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/minify/es6.js'), + entry: path.resolve(__dirname, "./fixtures/minify/es6.js"), output: { - path: path.resolve(__dirname, './dist-terser'), - filename: '[name].js', - chunkFilename: '[id].[name].js', + path: path.resolve(__dirname, "./dist-terser"), + filename: "[name].js", + chunkFilename: "[id].[name].js", }, }); new TerserPlugin({ minify(file) { // eslint-disable-next-line global-require - return require('terser').minify(file, { + return require("terser").minify(file, { mangle: { - reserved: ['baz'], + reserved: ["baz"], }, }); }, @@ -279,8 +279,8 @@ describe('minify option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); diff --git a/test/parallel-option.test.js b/test/parallel-option.test.js index de4e84d0..dfeaffa4 100644 --- a/test/parallel-option.test.js +++ b/test/parallel-option.test.js @@ -1,9 +1,9 @@ -import path from 'path'; -import os from 'os'; +import path from "path"; +import os from "os"; -import Worker from 'jest-worker'; +import Worker from "jest-worker"; -import TerserPlugin from '../src/index'; +import TerserPlugin from "../src/index"; import { compile, @@ -11,10 +11,10 @@ import { getErrors, getWarnings, readsAssets, -} from './helpers'; +} from "./helpers"; -jest.mock('os', () => { - const actualOs = jest.requireActual('os'); +jest.mock("os", () => { + const actualOs = jest.requireActual("os"); const mocked = { cpus: jest.fn(() => { @@ -30,11 +30,11 @@ let workerTransform; let workerEnd; const ENABLE_WORKER_THREADS = - typeof process.env.ENABLE_WORKER_THREADS !== 'undefined' - ? process.env.ENABLE_WORKER_THREADS === 'true' + typeof process.env.ENABLE_WORKER_THREADS !== "undefined" + ? process.env.ENABLE_WORKER_THREADS === "true" : true; -jest.mock('jest-worker', () => { +jest.mock("jest-worker", () => { return jest.fn().mockImplementation((workerPath) => { return { // eslint-disable-next-line global-require, import/no-dynamic-require @@ -49,9 +49,9 @@ jest.mock('jest-worker', () => { }); }); -const workerPath = require.resolve('../src/minify'); +const workerPath = require.resolve("../src/minify"); -describe('parallel option', () => { +describe("parallel option", () => { let compiler; beforeEach(() => { @@ -59,15 +59,15 @@ describe('parallel option', () => { compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/entry.js'), - two: path.resolve(__dirname, './fixtures/entry.js'), - three: path.resolve(__dirname, './fixtures/entry.js'), - four: path.resolve(__dirname, './fixtures/entry.js'), + one: path.resolve(__dirname, "./fixtures/entry.js"), + two: path.resolve(__dirname, "./fixtures/entry.js"), + three: path.resolve(__dirname, "./fixtures/entry.js"), + four: path.resolve(__dirname, "./fixtures/entry.js"), }, }); }); - it('should match snapshot when a value is not specify', async () => { + it("should match snapshot when a value is not specify", async () => { new TerserPlugin().apply(compiler); const stats = await compile(compiler); @@ -82,9 +82,9 @@ describe('parallel option', () => { ); expect(workerEnd).toHaveBeenCalledTimes(1); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "false" value', async () => { @@ -94,9 +94,9 @@ describe('parallel option', () => { expect(Worker).toHaveBeenCalledTimes(0); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "true" value', async () => { @@ -114,9 +114,9 @@ describe('parallel option', () => { ); expect(workerEnd).toHaveBeenCalledTimes(1); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "2" value', async () => { @@ -134,14 +134,14 @@ describe('parallel option', () => { ); expect(workerEnd).toHaveBeenCalledTimes(1); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "true" value when only one file passed', async () => { compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/entry.js'), + entry: path.resolve(__dirname, "./fixtures/entry.js"), }); new TerserPlugin({ parallel: true }).apply(compiler); @@ -158,16 +158,16 @@ describe('parallel option', () => { ); expect(workerEnd).toHaveBeenCalledTimes(1); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "true" value and the number of files is less than the number of cores', async () => { const entries = {}; for (let i = 0; i < os.cpus().length / 2; i++) { - entries[`entry-${i}`] = path.resolve(__dirname, './fixtures/entry.js'); + entries[`entry-${i}`] = path.resolve(__dirname, "./fixtures/entry.js"); } compiler = getCompiler({ entry: entries }); @@ -186,16 +186,16 @@ describe('parallel option', () => { ); expect(workerEnd).toHaveBeenCalledTimes(1); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "true" value and the number of files is same than the number of cores', async () => { const entries = {}; for (let i = 0; i < os.cpus().length; i++) { - entries[`entry-${i}`] = path.resolve(__dirname, './fixtures/entry.js'); + entries[`entry-${i}`] = path.resolve(__dirname, "./fixtures/entry.js"); } compiler = getCompiler({ entry: entries }); @@ -214,28 +214,28 @@ describe('parallel option', () => { ); expect(workerEnd).toHaveBeenCalledTimes(1); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "true" value and the number of files is more than the number of cores', async () => { const entries = {}; for (let i = 0; i < os.cpus().length * 2; i++) { - entries[`entry-${i}`] = path.resolve(__dirname, './fixtures/entry.js'); + entries[`entry-${i}`] = path.resolve(__dirname, "./fixtures/entry.js"); } compiler = getCompiler({ entry: { - one: path.resolve(__dirname, './fixtures/entry.js'), - two: path.resolve(__dirname, './fixtures/entry.js'), - three: path.resolve(__dirname, './fixtures/entry.js'), - four: path.resolve(__dirname, './fixtures/entry.js'), - five: path.resolve(__dirname, './fixtures/entry.js'), - six: path.resolve(__dirname, './fixtures/entry.js'), - seven: path.resolve(__dirname, './fixtures/entry.js'), - eight: path.resolve(__dirname, './fixtures/entry.js'), + one: path.resolve(__dirname, "./fixtures/entry.js"), + two: path.resolve(__dirname, "./fixtures/entry.js"), + three: path.resolve(__dirname, "./fixtures/entry.js"), + four: path.resolve(__dirname, "./fixtures/entry.js"), + five: path.resolve(__dirname, "./fixtures/entry.js"), + six: path.resolve(__dirname, "./fixtures/entry.js"), + seven: path.resolve(__dirname, "./fixtures/entry.js"), + eight: path.resolve(__dirname, "./fixtures/entry.js"), }, }); @@ -253,8 +253,8 @@ describe('parallel option', () => { ); expect(workerEnd).toHaveBeenCalledTimes(1); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); diff --git a/test/sourceMap-option.test.js b/test/sourceMap-option.test.js index 2c296bd1..6d612fb5 100644 --- a/test/sourceMap-option.test.js +++ b/test/sourceMap-option.test.js @@ -1,8 +1,8 @@ -import path from 'path'; +import path from "path"; -import { SourceMapDevToolPlugin } from 'webpack'; +import { SourceMapDevToolPlugin } from "webpack"; -import TerserPlugin from '../src/index'; +import TerserPlugin from "../src/index"; import { compile, @@ -10,17 +10,17 @@ import { getErrors, getWarnings, readsAssets, -} from './helpers'; +} from "./helpers"; expect.addSnapshotSerializer({ test: (value) => { // For string that are valid JSON - if (typeof value !== 'string') { + if (typeof value !== "string") { return false; } try { - return typeof JSON.parse(value) === 'object'; + return typeof JSON.parse(value) === "object"; } catch (e) { return false; } @@ -28,10 +28,10 @@ expect.addSnapshotSerializer({ print: (value) => JSON.stringify(JSON.parse(value), null, 2), }); -describe('sourceMap', () => { +describe("sourceMap", () => { it('should match snapshot when the "devtool" option has the "false" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/entry.js'), + entry: path.resolve(__dirname, "./fixtures/entry.js"), devtool: false, }); @@ -39,108 +39,108 @@ describe('sourceMap', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot when the "devtool" option has the "source-map" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/entry.js'), - devtool: 'source-map', + entry: path.resolve(__dirname, "./fixtures/entry.js"), + devtool: "source-map", }); new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot when the "devtool" option has the "inline-source-map" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/entry.js'), - devtool: 'inline-source-map', + entry: path.resolve(__dirname, "./fixtures/entry.js"), + devtool: "inline-source-map", }); new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot when the "devtool" option has the "hidden-source-map" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/entry.js'), - devtool: 'hidden-source-map', + entry: path.resolve(__dirname, "./fixtures/entry.js"), + devtool: "hidden-source-map", }); new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot when the "devtool" option has the "nosources-source-map" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/entry.js'), - devtool: 'nosources-source-map', + entry: path.resolve(__dirname, "./fixtures/entry.js"), + devtool: "nosources-source-map", }); new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot when the "devtool" option has the "eval" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/entry.js'), - devtool: 'eval', + entry: path.resolve(__dirname, "./fixtures/entry.js"), + devtool: "eval", }); new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot when the "devtool" option has the "cheap-source-map" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/entry.js'), - devtool: 'cheap-source-map', + entry: path.resolve(__dirname, "./fixtures/entry.js"), + devtool: "cheap-source-map", }); new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for the `SourceMapDevToolPlugin` plugin (like `source-map`)', async () => { + it("should match snapshot for the `SourceMapDevToolPlugin` plugin (like `source-map`)", async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/entry.js'), + entry: path.resolve(__dirname, "./fixtures/entry.js"), devtool: false, plugins: [ new SourceMapDevToolPlugin({ - filename: '[file].map[query]', + filename: "[file].map[query]", module: true, columns: true, }), @@ -151,18 +151,18 @@ describe('sourceMap', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for the `SourceMapDevToolPlugin` plugin (like `cheap-source-map`)', async () => { + it("should match snapshot for the `SourceMapDevToolPlugin` plugin (like `cheap-source-map`)", async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/entry.js'), + entry: path.resolve(__dirname, "./fixtures/entry.js"), devtool: false, plugins: [ new SourceMapDevToolPlugin({ - filename: '[file].map[query]', + filename: "[file].map[query]", module: false, columns: false, }), @@ -173,23 +173,23 @@ describe('sourceMap', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for multi compiler mode with source maps', async () => { + it("should match snapshot for multi compiler mode with source maps", async () => { const multiCompiler = getCompiler([ { - mode: 'production', - devtool: 'eval', + mode: "production", + devtool: "eval", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist'), - filename: '[name]-1.js', - chunkFilename: '[id]-1.[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name]-1.js", + chunkFilename: "[id]-1.[name].js", }, optimization: { minimize: false, @@ -197,15 +197,15 @@ describe('sourceMap', () => { plugins: [new TerserPlugin()], }, { - mode: 'production', - devtool: 'source-map', + mode: "production", + devtool: "source-map", bail: true, - cache: { type: 'memory' }, - entry: path.resolve(__dirname, './fixtures/entry.js'), + cache: { type: "memory" }, + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist'), - filename: '[name]-2.js', - chunkFilename: '[id]-2.[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name]-2.js", + chunkFilename: "[id]-2.[name].js", }, optimization: { minimize: false, @@ -213,22 +213,22 @@ describe('sourceMap', () => { plugins: [new TerserPlugin()], }, { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, + cache: { type: "memory" }, devtool: false, - entry: path.resolve(__dirname, './fixtures/entry.js'), + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist'), - filename: '[name]-3.js', - chunkFilename: '[id]-3.[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name]-3.js", + chunkFilename: "[id]-3.[name].js", }, optimization: { minimize: false, }, plugins: [ new SourceMapDevToolPlugin({ - filename: '[file].map[query]', + filename: "[file].map[query]", module: false, columns: false, }), @@ -236,22 +236,22 @@ describe('sourceMap', () => { ], }, { - mode: 'production', + mode: "production", bail: true, - cache: { type: 'memory' }, + cache: { type: "memory" }, devtool: false, - entry: path.resolve(__dirname, './fixtures/entry.js'), + entry: path.resolve(__dirname, "./fixtures/entry.js"), output: { - path: path.resolve(__dirname, './dist'), - filename: '[name]-4.js', - chunkFilename: '[id]-4.[name].js', + path: path.resolve(__dirname, "./dist"), + filename: "[name]-4.js", + chunkFilename: "[id]-4.[name].js", }, optimization: { minimize: false, }, plugins: [ new SourceMapDevToolPlugin({ - filename: '[file].map[query]', + filename: "[file].map[query]", module: true, columns: true, }), @@ -265,9 +265,9 @@ describe('sourceMap', () => { multiStats.stats.forEach((stats, index) => { expect( readsAssets(multiCompiler.compilers[index], stats) - ).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + ).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); }); diff --git a/test/terserOptions-option.test.js b/test/terserOptions-option.test.js index a1b7af96..c1ed84cb 100644 --- a/test/terserOptions-option.test.js +++ b/test/terserOptions-option.test.js @@ -1,6 +1,6 @@ -import path from 'path'; +import path from "path"; -import TerserPlugin from '../src/index'; +import TerserPlugin from "../src/index"; import { compile, @@ -8,13 +8,13 @@ import { getErrors, getWarnings, readsAssets, -} from './helpers'; +} from "./helpers"; -describe('terserOptions option', () => { +describe("terserOptions option", () => { it('should match snapshot for the "ecma" and set the option depending on the "output.environment" option ("es3")', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/ecma-5/entry.js'), - target: ['web', 'es3'], + entry: path.resolve(__dirname, "./fixtures/ecma-5/entry.js"), + target: ["web", "es3"], }); new TerserPlugin({ @@ -28,15 +28,15 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "ecma" and set the option depending on the "output.environment" option ("es5")', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/ecma-5/entry.js'), - target: ['web', 'es5'], + entry: path.resolve(__dirname, "./fixtures/ecma-5/entry.js"), + target: ["web", "es5"], }); new TerserPlugin({ @@ -50,15 +50,15 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "ecma" and set the option depending on the "output.environment" option ("es2020")', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/ecma-5/entry.js'), - target: ['web', 'es2020'], + entry: path.resolve(__dirname, "./fixtures/ecma-5/entry.js"), + target: ["web", "es2020"], }); new TerserPlugin({ @@ -72,14 +72,14 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "ecma" option with the "5" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/ecma-5/entry.js'), + entry: path.resolve(__dirname, "./fixtures/ecma-5/entry.js"), }); new TerserPlugin({ @@ -94,14 +94,14 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "ecma" option with the "6" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/ecma-6/entry.js'), + entry: path.resolve(__dirname, "./fixtures/ecma-6/entry.js"), }); new TerserPlugin({ @@ -116,14 +116,14 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "ecma" option with the "7" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/ecma-7/entry.js'), + entry: path.resolve(__dirname, "./fixtures/ecma-7/entry.js"), }); new TerserPlugin({ @@ -138,14 +138,14 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "ecma" option with the "8" value', async () => { const compiler = getCompiler({ - entry: path.resolve(__dirname, './fixtures/ecma-8/entry.js'), + entry: path.resolve(__dirname, "./fixtures/ecma-8/entry.js"), }); new TerserPlugin({ @@ -160,9 +160,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "parse.ecma" option with the "8" value', async () => { @@ -178,9 +178,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "compress" option with the "false" value', async () => { @@ -194,9 +194,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "compress" option with the "true" value', async () => { @@ -210,9 +210,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "compress" option with an object value', async () => { @@ -228,9 +228,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "mangle" option with the "false" value', async () => { @@ -244,9 +244,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "mangle" option with the "true" value', async () => { @@ -260,9 +260,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "mangle" option with object values', async () => { @@ -271,16 +271,16 @@ describe('terserOptions option', () => { new TerserPlugin({ terserOptions: { mangle: { - reserved: ['baz'], + reserved: ["baz"], }, }, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "module" option with the "false" value', async () => { @@ -294,9 +294,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "module" option with the "true" value', async () => { @@ -310,9 +310,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "output.beautify" option with "true" value', async () => { @@ -328,9 +328,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "output.comments" option with the "true"', async () => { @@ -346,9 +346,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "format.beautify" option with "true" value', async () => { @@ -364,9 +364,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "format.comments" option with the "true"', async () => { @@ -382,9 +382,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "toplevel" option with the "false" value', async () => { @@ -398,9 +398,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "toplevel" option with the "true" value', async () => { @@ -414,9 +414,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "nameCache" option with a empty object value', async () => { @@ -430,9 +430,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "ie8" option with the "false" value', async () => { @@ -446,9 +446,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "ie8" option with the "true" value', async () => { @@ -462,9 +462,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "keep_classnames" option with the "false" value', async () => { @@ -478,9 +478,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "keep_classnames" option with the "true" value', async () => { @@ -494,9 +494,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "keep_fnames" option with the "false" value', async () => { @@ -510,9 +510,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "keep_fnames" option with the "true" value', async () => { @@ -526,9 +526,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "safari10" option with the "false" value', async () => { @@ -542,9 +542,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "safari10" option with the "true" value', async () => { @@ -558,9 +558,9 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for the "unknown" option', async () => { @@ -577,7 +577,7 @@ describe('terserOptions option', () => { const stats = await compile(compiler); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); diff --git a/test/test-option.test.js b/test/test-option.test.js index 8a94a136..5eba125d 100644 --- a/test/test-option.test.js +++ b/test/test-option.test.js @@ -1,6 +1,6 @@ -import path from 'path'; +import path from "path"; -import TerserPlugin from '../src/index'; +import TerserPlugin from "../src/index"; import { compile, @@ -8,65 +8,65 @@ import { getErrors, getWarnings, readsAssets, -} from './helpers'; +} from "./helpers"; -describe('test option', () => { +describe("test option", () => { let compiler; beforeEach(() => { compiler = getCompiler({ entry: { - js: path.resolve(__dirname, './fixtures/entry.js'), - mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + js: path.resolve(__dirname, "./fixtures/entry.js"), + mjs: path.resolve(__dirname, "./fixtures/entry.mjs"), importExport: path.resolve( __dirname, - './fixtures/import-export/entry.js' + "./fixtures/import-export/entry.js" ), AsyncImportExport: path.resolve( __dirname, - './fixtures/async-import-export/entry.js' + "./fixtures/async-import-export/entry.js" ), }, output: { - path: path.resolve(__dirname, './dist'), + path: path.resolve(__dirname, "./dist"), filename: `[name].js?var=[fullhash]`, chunkFilename: `[id].[name].js?ver=[fullhash]`, }, }); }); - it('should match snapshot with empty value', async () => { + it("should match snapshot with empty value", async () => { new TerserPlugin().apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); - it('should match snapshot for a single `test` value ({RegExp})', async () => { + it("should match snapshot for a single `test` value ({RegExp})", async () => { new TerserPlugin({ test: /(m)?js\.js(\?.*)?$/i, }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for a single "test" value ({String})', async () => { new TerserPlugin({ - test: 'js.js', + test: "js.js", }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for multiple "test" values ({RegExp})', async () => { @@ -76,39 +76,39 @@ describe('test option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot for multiple "test" values ({String})', async () => { new TerserPlugin({ - test: ['js.js', 'AsyncImportExport.js'], + test: ["js.js", "AsyncImportExport.js"], }).apply(compiler); const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); it('should match snapshot and uglify "mjs"', async () => { compiler = getCompiler({ entry: { - js: path.resolve(__dirname, './fixtures/entry.js'), - mjs: path.resolve(__dirname, './fixtures/entry.mjs'), + js: path.resolve(__dirname, "./fixtures/entry.js"), + mjs: path.resolve(__dirname, "./fixtures/entry.mjs"), importExport: path.resolve( __dirname, - './fixtures/import-export/entry.js' + "./fixtures/import-export/entry.js" ), AsyncImportExport: path.resolve( __dirname, - './fixtures/async-import-export/entry.js' + "./fixtures/async-import-export/entry.js" ), }, output: { - path: path.resolve(__dirname, './dist'), + path: path.resolve(__dirname, "./dist"), filename: `[name].mjs?var=[fullhash]`, chunkFilename: `[id].[name].mjs?ver=[fullhash]`, }, @@ -118,8 +118,8 @@ describe('test option', () => { const stats = await compile(compiler); - expect(readsAssets(compiler, stats)).toMatchSnapshot('assets'); - expect(getErrors(stats)).toMatchSnapshot('errors'); - expect(getWarnings(stats)).toMatchSnapshot('warnings'); + expect(readsAssets(compiler, stats)).toMatchSnapshot("assets"); + expect(getErrors(stats)).toMatchSnapshot("errors"); + expect(getWarnings(stats)).toMatchSnapshot("warnings"); }); }); diff --git a/test/validate-options.test.js b/test/validate-options.test.js index 480f8b33..7ebd8d93 100644 --- a/test/validate-options.test.js +++ b/test/validate-options.test.js @@ -1,13 +1,13 @@ -import TerserPlugin from '../src'; +import TerserPlugin from "../src"; -it('validation', () => { +it("validation", () => { /* eslint-disable no-new */ expect(() => { new TerserPlugin({ test: /foo/ }); }).not.toThrow(); expect(() => { - new TerserPlugin({ test: 'foo' }); + new TerserPlugin({ test: "foo" }); }).not.toThrow(); expect(() => { @@ -19,11 +19,11 @@ it('validation', () => { }).not.toThrow(); expect(() => { - new TerserPlugin({ test: ['foo', 'bar'] }); + new TerserPlugin({ test: ["foo", "bar"] }); }).not.toThrow(); expect(() => { - new TerserPlugin({ test: [/foo/, 'bar'] }); + new TerserPlugin({ test: [/foo/, "bar"] }); }).not.toThrow(); expect(() => { @@ -39,7 +39,7 @@ it('validation', () => { }).not.toThrow(); expect(() => { - new TerserPlugin({ include: 'foo' }); + new TerserPlugin({ include: "foo" }); }).not.toThrow(); expect(() => { @@ -51,11 +51,11 @@ it('validation', () => { }).not.toThrow(); expect(() => { - new TerserPlugin({ include: ['foo', 'bar'] }); + new TerserPlugin({ include: ["foo", "bar"] }); }).not.toThrow(); expect(() => { - new TerserPlugin({ include: [/foo/, 'bar'] }); + new TerserPlugin({ include: [/foo/, "bar"] }); }).not.toThrow(); expect(() => { @@ -71,7 +71,7 @@ it('validation', () => { }).not.toThrow(); expect(() => { - new TerserPlugin({ exclude: 'foo' }); + new TerserPlugin({ exclude: "foo" }); }).not.toThrow(); expect(() => { @@ -83,11 +83,11 @@ it('validation', () => { }).not.toThrow(); expect(() => { - new TerserPlugin({ exclude: ['foo', 'bar'] }); + new TerserPlugin({ exclude: ["foo", "bar"] }); }).not.toThrow(); expect(() => { - new TerserPlugin({ exclude: [/foo/, 'bar'] }); + new TerserPlugin({ exclude: [/foo/, "bar"] }); }).not.toThrow(); expect(() => { @@ -111,7 +111,7 @@ it('validation', () => { }).not.toThrow(); expect(() => { - new TerserPlugin({ parallel: '2' }); + new TerserPlugin({ parallel: "2" }); }).toThrowErrorMatchingSnapshot(); expect(() => { @@ -167,7 +167,7 @@ it('validation', () => { }).not.toThrow(); expect(() => { - new TerserPlugin({ extractComments: 'comment' }); + new TerserPlugin({ extractComments: "comment" }); }).not.toThrow(); expect(() => { @@ -189,7 +189,7 @@ it('validation', () => { expect(() => { new TerserPlugin({ extractComments: { - condition: 'comment', + condition: "comment", }, }); }).not.toThrow(); @@ -221,7 +221,7 @@ it('validation', () => { expect(() => { new TerserPlugin({ extractComments: { - filename: 'test.js', + filename: "test.js", }, }); }).not.toThrow(); @@ -253,7 +253,7 @@ it('validation', () => { expect(() => { new TerserPlugin({ extractComments: { - banner: 'banner', + banner: "banner", }, }); }).not.toThrow(); diff --git a/test/worker.test.js b/test/worker.test.js index 84e99f4d..479839a0 100644 --- a/test/worker.test.js +++ b/test/worker.test.js @@ -1,13 +1,13 @@ -import serialize from 'serialize-javascript'; +import serialize from "serialize-javascript"; -import { transform } from '../src/minify'; +import { transform } from "../src/minify"; -describe('worker', () => { +describe("worker", () => { it('should match snapshot when options.extractComments is "false"', async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", extractComments: false, }; const workerResult = await transform(serialize(options)); @@ -17,9 +17,9 @@ describe('worker', () => { it('should match snapshot when options.extractComments is "true"', async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", extractComments: true, }; const workerResult = await transform(serialize(options)); @@ -27,11 +27,11 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when options.extractComments is RegExp', async () => { + it("should match snapshot when options.extractComments is RegExp", async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", extractComments: /hello/, }; const workerResult = await transform(serialize(options)); @@ -39,11 +39,11 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when options.extractComments is Function', async () => { + it("should match snapshot when options.extractComments is Function", async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", extractComments: () => true, }; const workerResult = await transform(serialize(options)); @@ -51,11 +51,11 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when options.extractComments is empty Object', async () => { + it("should match snapshot when options.extractComments is empty Object", async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", extractComments: {}, }; const workerResult = await transform(serialize(options)); @@ -65,9 +65,9 @@ describe('worker', () => { it('should match snapshot when options.extractComments is Object with "true" value', async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", extractComments: { condition: true, }, @@ -79,11 +79,11 @@ describe('worker', () => { it('should match snapshot when options.extractComments is Object with "some" value', async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", extractComments: { - condition: 'some', + condition: "some", }, }; const workerResult = await transform(serialize(options)); @@ -93,11 +93,11 @@ describe('worker', () => { it('should match snapshot when options.extractComments is Object with "all" value', async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", extractComments: { - condition: 'all', + condition: "all", }, }; const workerResult = await transform(serialize(options)); @@ -107,10 +107,10 @@ describe('worker', () => { it('should match snapshot when options.extractComments is "all" value', async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', - extractComments: 'all', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", + extractComments: "all", }; const workerResult = await transform(serialize(options)); @@ -119,24 +119,24 @@ describe('worker', () => { it('should match snapshot when options.extractComments is "some" value', async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', - extractComments: 'some', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", + extractComments: "some", }; const workerResult = await transform(serialize(options)); expect(workerResult).toMatchSnapshot(); }); - it('normalizes when minimizerOptions.output.comments is string: all', async () => { + it("normalizes when minimizerOptions.output.comments is string: all", async () => { const options = { - name: 'test2.js', + name: "test2.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", minifyOptions: { output: { - comments: 'all', + comments: "all", }, }, }; @@ -145,11 +145,11 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when minimizerOptions.compress.comments is boolean', async () => { + it("should match snapshot when minimizerOptions.compress.comments is boolean", async () => { const options = { - name: 'test3.js', + name: "test3.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", minifyOptions: { compress: true, }, @@ -159,11 +159,11 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when minimizerOptions.compress.comments is object', async () => { + it("should match snapshot when minimizerOptions.compress.comments is object", async () => { const options = { - name: 'test3.js', + name: "test3.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", minifyOptions: { compress: { passes: 2, @@ -175,14 +175,14 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when minimizerOptions.output.comments is string: some', async () => { + it("should match snapshot when minimizerOptions.output.comments is string: some", async () => { const options = { - name: 'test3.js', + name: "test3.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", minifyOptions: { output: { - comments: 'some', + comments: "some", }, }, }; @@ -191,14 +191,14 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when minimizerOptions.extractComments is number', async () => { + it("should match snapshot when minimizerOptions.extractComments is number", async () => { const options = { - name: 'test4.js', + name: "test4.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", minifyOptions: { output: { - comments: 'some', + comments: "some", }, }, extractComments: 1, @@ -208,18 +208,18 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot with extract option set to a single file', async () => { + it("should match snapshot with extract option set to a single file", async () => { const options = { - name: 'test5.js', - input: '/******/ function hello(a) {console.log(a)}', + name: "test5.js", + input: "/******/ function hello(a) {console.log(a)}", minifyOptions: { output: { - comments: 'all', + comments: "all", }, }, extractComments: { - condition: 'should be extracted', - filename: (file) => file.filename.replace(/(\.\w+)$/, '.license$1'), + condition: "should be extracted", + filename: (file) => file.filename.replace(/(\.\w+)$/, ".license$1"), banner: (licenseFile) => `License information can be found in ${licenseFile}`, }, @@ -229,15 +229,15 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot with options.inputSourceMap', async () => { + it("should match snapshot with options.inputSourceMap", async () => { const options = { - name: 'test6.js', - input: 'function foo(x) { if (x) { return bar(); not_called1(); } }', + name: "test6.js", + input: "function foo(x) { if (x) { return bar(); not_called1(); } }", inputSourceMap: { version: 3, - sources: ['test1.js'], - names: ['foo', 'x', 'bar', 'not_called1'], - mappings: 'AAAA,QAASA,KAAIC,GACT,GAAIA,EAAG,CACH,MAAOC,MACPC', + sources: ["test1.js"], + names: ["foo", "x", "bar", "not_called1"], + mappings: "AAAA,QAASA,KAAIC,GACT,GAAIA,EAAG,CACH,MAAOC,MACPC", }, }; const workerResult = await transform(serialize(options)); @@ -247,11 +247,11 @@ describe('worker', () => { it('should match snapshot when options.extractComments is "true"', async () => { const options = { - name: 'test1.js', + name: "test1.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", minify: (item) => { - return item['test1.js']; + return item["test1.js"]; }, }; const workerResult = await transform(serialize(options)); @@ -261,9 +261,9 @@ describe('worker', () => { it('should match snapshot when minimizerOptions.mangle is "null"', async () => { const options = { - name: 'test4.js', + name: "test4.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", minifyOptions: { mangle: null, }, @@ -273,11 +273,11 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when minimizerOptions.mangle is boolean', async () => { + it("should match snapshot when minimizerOptions.mangle is boolean", async () => { const options = { - name: 'test4.js', + name: "test4.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", minifyOptions: { mangle: true, }, @@ -287,11 +287,11 @@ describe('worker', () => { expect(workerResult).toMatchSnapshot(); }); - it('should match snapshot when minimizerOptions.mangle is object', async () => { + it("should match snapshot when minimizerOptions.mangle is object", async () => { const options = { - name: 'test4.js', + name: "test4.js", input: - 'var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */', + "var foo = 1;/* hello */\n// Comment\n/* duplicate */\n/* duplicate */", minifyOptions: { mangle: { toplevel: true }, },