diff --git a/CHANGELOG.md b/CHANGELOG.md index e8090ea..abdb126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [1.1.2](https://github.com/webpack-contrib/css-minimizer-webpack-plugin/compare/v1.1.1...v1.1.2) (2020-08-24) + + +### Bug Fixes + +* compatibility with webpack 5 ([6232829](https://github.com/webpack-contrib/css-minimizer-webpack-plugin/commit/62328298d6a81f31e773d11ced8811ee41cd0470)) + ### [1.1.1](https://github.com/webpack-contrib/css-minimizer-webpack-plugin/compare/v1.1.0...v1.1.1) (2020-08-10) diff --git a/package-lock.json b/package-lock.json index 3d492db..e4992a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "css-minimizer-webpack-plugin", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -74,16 +74,16 @@ } }, "@babel/core": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.1.tgz", - "integrity": "sha512-XqF7F6FWQdKGGWAzGELL+aCO1p+lRY5Tj5/tbT3St1G8NaH70jhhDIKknIZaDans0OQBG5wRAldROLHSt44BgQ==", + "version": "7.11.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.4.tgz", + "integrity": "sha512-5deljj5HlqRXN+5oJTY7Zs37iH3z3b++KjiKtIsJy1NrjOOVSEaJHEetLBhyu0aQOSNNZ/0IuEAan9GzRuDXHg==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.0", + "@babel/generator": "^7.11.4", "@babel/helper-module-transforms": "^7.11.0", "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.11.1", + "@babel/parser": "^7.11.4", "@babel/template": "^7.10.4", "@babel/traverse": "^7.11.0", "@babel/types": "^7.11.0", @@ -97,12 +97,6 @@ "source-map": "^0.5.0" }, "dependencies": { - "@babel/parser": { - "version": "7.11.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.3.tgz", - "integrity": "sha512-REo8xv7+sDxkKvoxEywIdsNFiZLybwdI7hcT5uEPyQrSMB4YQ973BfC9OOrD/81MaIjh6UxdulIQXkjmiH3PcA==", - "dev": true - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -133,9 +127,9 @@ } }, "@babel/generator": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.0.tgz", - "integrity": "sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ==", + "version": "7.11.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.4.tgz", + "integrity": "sha512-Rn26vueFx0eOoz7iifCN2UHT6rGtnkSGWSoDRIy8jZN3B91PzeSULbswfLoOWuTuAcNwpG/mxy+uCTDnZ9Mp1g==", "dev": true, "requires": { "@babel/types": "^7.11.0", @@ -228,12 +222,11 @@ } }, "@babel/helper-explode-assignable-expression": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.10.4.tgz", - "integrity": "sha512-4K71RyRQNPRrR85sr5QY4X3VwG4wtVoXZB9+L3r1Gp38DhELyHCtovqydRi7c1Ovb17eRGiQ/FD5s8JdU0Uy5A==", + "version": "7.11.4", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.11.4.tgz", + "integrity": "sha512-ux9hm3zR4WV1Y3xXxXkdG/0gxF9nvI0YVmKVhvK9AfMoaQkemL3sJpXw+Xbz65azo8qJiEz2XVDUpK3KYhH3ZQ==", "dev": true, "requires": { - "@babel/traverse": "^7.10.4", "@babel/types": "^7.10.4" } }, @@ -324,15 +317,14 @@ } }, "@babel/helper-remap-async-to-generator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.10.4.tgz", - "integrity": "sha512-86Lsr6NNw3qTNl+TBcF1oRZMaVzJtbWTyTko+CQL/tvNvcGYEFKbLXDPxtW0HKk3McNOk4KzY55itGWCAGK5tg==", + "version": "7.11.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.11.4.tgz", + "integrity": "sha512-tR5vJ/vBa9wFy3m5LLv2faapJLnDFxNWff2SAYkSE4rLUdbp7CdObYFgI7wK4T/Mj4UzpjPwzR8Pzmr5m7MHGA==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.10.4", "@babel/helper-wrap-function": "^7.10.4", "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", "@babel/types": "^7.10.4" } }, @@ -417,9 +409,9 @@ } }, "@babel/parser": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.0.tgz", - "integrity": "sha512-qvRvi4oI8xii8NllyEc4MDJjuZiNaRzyb7Y7lup1NqJV8TZHF4O27CcP+72WPn/k1zkgJ6WJfnIbk4jTsVAZHw==", + "version": "7.11.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.4.tgz", + "integrity": "sha512-MggwidiH+E9j5Sh8pbrX5sJvMcsqS5o+7iB42M9/k0CD63MjYbdP4nhSh7uB5wnv2/RVzTZFTxzF/kIa5mrCqA==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { @@ -711,9 +703,9 @@ } }, "@babel/plugin-transform-block-scoping": { - "version": "7.10.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.10.5.tgz", - "integrity": "sha512-6Ycw3hjpQti0qssQcA6AMSFDHeNJ++R6dIMnpRqUjFeBBTmTDPa8zgF90OVfTvAo11mXZTlVUViY1g8ffrURLg==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.11.1.tgz", + "integrity": "sha512-00dYeDE0EVEHuuM+26+0w/SCL0BH2Qy7LwHuI4Hi4MH5gkC8/AqMN5uWFJIsoXZrAphiMm1iXzBw6L2T+eA0ew==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -1094,9 +1086,9 @@ } }, "@babel/runtime": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.0.tgz", - "integrity": "sha512-qArkXsjJq7H+T86WrIFV0Fnu/tNOkZ4cgXmjkzAu3b/58D5mFIO8JH/y77t7C9q0OdDRdh9s7Ue5GasYssxtXw==", + "version": "7.11.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", + "integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -1253,12 +1245,12 @@ } }, "@commitlint/config-conventional": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-9.1.1.tgz", - "integrity": "sha512-t/bvv8ofjj7V4W99eVDyuACaC7Ch4SYaukglBYt/K1Y9Ixg8mCBuFDMGRMhyZn4upUe1ls8l4SO3rjaVbYIjlg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-10.0.0.tgz", + "integrity": "sha512-M9l7hh2a1GB9nQ/Gm+aDLGPmzGdpgxqJoSmrbTxDlapJDyaL7FPe5aQf66F50Eq3j0bmaRaJihFCA6mIUBQAag==", "dev": true, "requires": { - "conventional-changelog-conventionalcommits": "4.3.0" + "conventional-changelog-conventionalcommits": "^4.3.1" } }, "@commitlint/ensure": { @@ -1457,14 +1449,14 @@ } }, "parse-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", - "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", + "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-better-errors": "^1.0.1", + "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, @@ -1596,12 +1588,6 @@ "resolve-from": "^5.0.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 - }, "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -1689,13 +1675,13 @@ } }, "@jest/core": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.3.0.tgz", - "integrity": "sha512-WAAqGMpc+U+GS0oSr/ikI1JdRyPQyTZSVOr1xjnVcfvfUTZCK+wGoN0Cb7dm7HVdpbMQr/NvtM6vBVChctmzHA==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.4.2.tgz", + "integrity": "sha512-sDva7YkeNprxJfepOctzS8cAk9TOekldh+5FhVuXS40+94SHbiicRO1VV2tSoRtgIo+POs/Cdyf8p76vPTd6dg==", "dev": true, "requires": { "@jest/console": "^26.3.0", - "@jest/reporters": "^26.3.0", + "@jest/reporters": "^26.4.1", "@jest/test-result": "^26.3.0", "@jest/transform": "^26.3.0", "@jest/types": "^26.3.0", @@ -1705,17 +1691,17 @@ "exit": "^0.1.2", "graceful-fs": "^4.2.4", "jest-changed-files": "^26.3.0", - "jest-config": "^26.3.0", + "jest-config": "^26.4.2", "jest-haste-map": "^26.3.0", "jest-message-util": "^26.3.0", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.3.0", - "jest-resolve-dependencies": "^26.3.0", - "jest-runner": "^26.3.0", - "jest-runtime": "^26.3.0", - "jest-snapshot": "^26.3.0", + "jest-resolve": "^26.4.0", + "jest-resolve-dependencies": "^26.4.2", + "jest-runner": "^26.4.2", + "jest-runtime": "^26.4.2", + "jest-snapshot": "^26.4.2", "jest-util": "^26.3.0", - "jest-validate": "^26.3.0", + "jest-validate": "^26.4.2", "jest-watcher": "^26.3.0", "micromatch": "^4.0.2", "p-each-series": "^2.1.0", @@ -1852,20 +1838,20 @@ } }, "@jest/globals": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.3.0.tgz", - "integrity": "sha512-oPe30VG9zor2U3Ev7khCM2LkjO3D+mgAv6s5D3Ed0sxfELxoRZwR8d1VgYWVQljcpumMwe9tDrKNuzgVjbEt7g==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.4.2.tgz", + "integrity": "sha512-Ot5ouAlehhHLRhc+sDz2/9bmNv9p5ZWZ9LE1pXGGTCXBasmi5jnYjlgYcYt03FBwLmZXCZ7GrL29c33/XRQiow==", "dev": true, "requires": { "@jest/environment": "^26.3.0", "@jest/types": "^26.3.0", - "expect": "^26.3.0" + "expect": "^26.4.2" } }, "@jest/reporters": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.3.0.tgz", - "integrity": "sha512-MfLJOUPxhGb3sRT/wFjHXd6gyVQ1Fb1XxbEwY+gqdDBpg3pq5qAB5eiBUvcTheFRHmhu3gOv3UZ/gtxmqGBA+Q==", + "version": "26.4.1", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.4.1.tgz", + "integrity": "sha512-aROTkCLU8++yiRGVxLsuDmZsQEKO6LprlrxtAuzvtpbIFl3eIjgIf3EUxDKgomkS25R9ZzwGEdB5weCcBZlrpQ==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", @@ -1884,10 +1870,10 @@ "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", "jest-haste-map": "^26.3.0", - "jest-resolve": "^26.3.0", + "jest-resolve": "^26.4.0", "jest-util": "^26.3.0", "jest-worker": "^26.3.0", - "node-notifier": "^7.0.0", + "node-notifier": "^8.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", "string-length": "^4.0.1", @@ -1985,16 +1971,16 @@ } }, "@jest/test-sequencer": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.3.0.tgz", - "integrity": "sha512-G7TA0Z85uj5l1m9UKZ/nXbArn0y+MeLKbojNLDHgjb1PpNNFDAOO6FJhk9We34m/hadcciMcJFnxV94dV2TX+w==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.4.2.tgz", + "integrity": "sha512-83DRD8N3M0tOhz9h0bn6Kl6dSp+US6DazuVF8J9m21WAp5x7CqSMaNycMP0aemC/SH/pDQQddbsfHRTBXVUgog==", "dev": true, "requires": { "@jest/test-result": "^26.3.0", "graceful-fs": "^4.2.4", "jest-haste-map": "^26.3.0", - "jest-runner": "^26.3.0", - "jest-runtime": "^26.3.0" + "jest-runner": "^26.4.2", + "jest-runtime": "^26.4.2" } }, "@jest/transform": { @@ -2352,9 +2338,9 @@ "dev": true }, "@types/node": { - "version": "14.0.27", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.27.tgz", - "integrity": "sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==" + "version": "14.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.0.tgz", + "integrity": "sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -2632,9 +2618,9 @@ } }, "abab": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", - "integrity": "sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.4.tgz", + "integrity": "sha512-Eu9ELJWCz/c1e9gTiCY+FceWxcqzjYEbqMgtndnuSqZSUCOL73TWNK2mHfIj4Cw2E/ongOp+JISVNCmovt2KYQ==", "dev": true }, "abbrev": { @@ -2644,9 +2630,9 @@ "dev": true }, "acorn": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", - "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", + "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", "dev": true }, "acorn-globals": { @@ -2678,18 +2664,18 @@ "dev": true }, "aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "requires": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" } }, "ajv": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", - "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -2865,9 +2851,9 @@ } }, "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "asn1": { @@ -2880,14 +2866,15 @@ } }, "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", "dev": true, "requires": { "bn.js": "^4.0.0", "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" }, "dependencies": { "bn.js": { @@ -2975,9 +2962,9 @@ "dev": true }, "aws4": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", - "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", "dev": true }, "babel-code-frame": { @@ -3290,9 +3277,9 @@ "dev": true }, "bn.js": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", - "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", "dev": true }, "boolbase": { @@ -3406,16 +3393,16 @@ } }, "browserify-sign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.0.tgz", - "integrity": "sha512-hEZC1KEeYuoHRqhGhTy6gWrpJA3ZDjFWv0DE61643ZnOXAKJb3u7yWcrU0mMc9SwAqK1n7myPGndkp0dFG7NFA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", "dev": true, "requires": { "bn.js": "^5.1.1", "browserify-rsa": "^4.0.1", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.2", + "elliptic": "^6.5.3", "inherits": "^2.0.4", "parse-asn1": "^5.1.5", "readable-stream": "^3.6.0", @@ -3445,14 +3432,14 @@ } }, "browserslist": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.13.0.tgz", - "integrity": "sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ==", + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.0.tgz", + "integrity": "sha512-pUsXKAF2lVwhmtpeA3LJrZ76jXuusrNyhduuQs7CDFf9foT4Y38aQOserd2lMe5DSSrjf3fx34oHwryuvxAUgQ==", "requires": { - "caniuse-lite": "^1.0.30001093", - "electron-to-chromium": "^1.3.488", - "escalade": "^3.0.1", - "node-releases": "^1.1.58" + "caniuse-lite": "^1.0.30001111", + "electron-to-chromium": "^1.3.523", + "escalade": "^3.0.2", + "node-releases": "^1.1.60" } }, "bser": { @@ -3556,9 +3543,9 @@ "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=" }, "camelcase": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz", - "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "camelcase-keys": { @@ -3570,14 +3557,6 @@ "camelcase": "^5.3.1", "map-obj": "^4.0.0", "quick-lru": "^4.0.1" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } } }, "caniuse-api": { @@ -3592,9 +3571,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001109", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001109.tgz", - "integrity": "sha512-4JIXRodHzdS3HdK8nSgIqXYLExOvG+D2/EenSvcub2Kp3QEADjo2v2oUn5g0n0D+UNwG9BtwKOyGcSq2qvQXvQ==" + "version": "1.0.30001117", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001117.tgz", + "integrity": "sha512-4tY0Fatzdx59kYjQs+bNxUwZB03ZEBgVmJ1UkFPz/Q8OLiUUbjct2EdpnXj0fvFTPej2EkbPIG0w8BWsjAyk1Q==" }, "capture-exit": { "version": "2.0.0", @@ -3921,9 +3900,9 @@ } }, "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, "requires": { "pump": "^3.0.0" @@ -3982,30 +3961,13 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, "compare-func": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz", - "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", "dev": true, "requires": { "array-ify": "^1.0.0", - "dot-prop": "^3.0.0" - }, - "dependencies": { - "dot-prop": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", - "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - } + "dot-prop": "^5.1.0" } }, "compare-versions": { @@ -4075,31 +4037,31 @@ "dev": true }, "conventional-changelog": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.21.tgz", - "integrity": "sha512-ZGecVZPEo3aC75VVE4nu85589dDhpMyqfqgUM5Myq6wfKWiNqhDJLSDMsc8qKXshZoY7dqs1hR0H/15kI/G2jQ==", + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.23.tgz", + "integrity": "sha512-sScUu2NHusjRC1dPc5p8/b3kT78OYr95/Bx7Vl8CPB8tF2mG1xei5iylDTRjONV5hTlzt+Cn/tBWrKdd299b7A==", "dev": true, "requires": { - "conventional-changelog-angular": "^5.0.10", + "conventional-changelog-angular": "^5.0.11", "conventional-changelog-atom": "^2.0.7", "conventional-changelog-codemirror": "^2.0.7", - "conventional-changelog-conventionalcommits": "^4.3.0", - "conventional-changelog-core": "^4.1.7", + "conventional-changelog-conventionalcommits": "^4.4.0", + "conventional-changelog-core": "^4.2.0", "conventional-changelog-ember": "^2.0.8", "conventional-changelog-eslint": "^3.0.8", "conventional-changelog-express": "^2.0.5", "conventional-changelog-jquery": "^3.0.10", - "conventional-changelog-jshint": "^2.0.7", + "conventional-changelog-jshint": "^2.0.8", "conventional-changelog-preset-loader": "^2.3.4" } }, "conventional-changelog-angular": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.10.tgz", - "integrity": "sha512-k7RPPRs0vp8+BtPsM9uDxRl6KcgqtCJmzRD1wRtgqmhQ96g8ifBGo9O/TZBG23jqlXS/rg8BKRDELxfnQQGiaA==", + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz", + "integrity": "sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==", "dev": true, "requires": { - "compare-func": "^1.3.1", + "compare-func": "^2.0.0", "q": "^1.5.1" } }, @@ -4128,30 +4090,30 @@ "dev": true }, "conventional-changelog-conventionalcommits": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.3.0.tgz", - "integrity": "sha512-oYHydvZKU+bS8LnGqTMlNrrd7769EsuEHKy4fh1oMdvvDi7fem8U+nvfresJ1IDB8K00Mn4LpiA/lR+7Gs6rgg==", + "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": "^1.3.1", + "compare-func": "^2.0.0", "lodash": "^4.17.15", "q": "^1.5.1" } }, "conventional-changelog-core": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.1.7.tgz", - "integrity": "sha512-UBvSrQR2RdKbSQKh7RhueiiY4ZAIOW3+CSWdtKOwRv+KxIMNFKm1rOcGBFx0eA8AKhGkkmmacoTWJTqyz7Q0VA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.0.tgz", + "integrity": "sha512-8+xMvN6JvdDtPbGBqA7oRNyZD4od1h/SIzrWqHcKZjitbVXrFpozEeyn4iI4af1UwdrabQpiZMaV07fPUTGd4w==", "dev": true, "requires": { "add-stream": "^1.0.0", - "conventional-changelog-writer": "^4.0.16", + "conventional-changelog-writer": "^4.0.17", "conventional-commits-parser": "^3.1.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.0.0", + "git-semver-tags": "^4.1.0", "lodash": "^4.17.15", "normalize-package-data": "^2.3.5", "q": "^1.5.1", @@ -4161,12 +4123,6 @@ "through2": "^3.0.0" }, "dependencies": { - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -4421,12 +4377,12 @@ } }, "conventional-changelog-jshint": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.7.tgz", - "integrity": "sha512-qHA8rmwUnLiIxANJbz650+NVzqDIwNtc0TcpIa0+uekbmKHttidvQ1dGximU3vEDdoJVKFgR3TXFqYuZmYy9ZQ==", + "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==", "dev": true, "requires": { - "compare-func": "^1.3.1", + "compare-func": "^2.0.0", "q": "^1.5.1" } }, @@ -4437,12 +4393,12 @@ "dev": true }, "conventional-changelog-writer": { - "version": "4.0.16", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.16.tgz", - "integrity": "sha512-jmU1sDJDZpm/dkuFxBeRXvyNcJQeKhGtVcFFkwTphUAzyYWcwz2j36Wcv+Mv2hU3tpvLMkysOPXJTLO55AUrYQ==", + "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==", "dev": true, "requires": { - "compare-func": "^1.3.1", + "compare-func": "^2.0.0", "conventional-commits-filter": "^2.0.6", "dateformat": "^3.0.0", "handlebars": "^4.7.6", @@ -4480,9 +4436,9 @@ } }, "conventional-recommended-bump": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.0.9.tgz", - "integrity": "sha512-DpRmW1k8CpRrcsXHOPGgHgOd4BMGiq2gtXAveGM8B9pSd9b4r4WKnqp1Fd0vkDtk8l973mIk8KKKUYnKRr9SFw==", + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.0.10.tgz", + "integrity": "sha512-2ibrqAFMN3ZA369JgVoSbajdD/BHN6zjY7DZFKTHzyzuQejDUCjQ85S5KHxCRxNwsbDJhTPD5hOKcis/jQhRgg==", "dev": true, "requires": { "concat-stream": "^2.0.0", @@ -4490,17 +4446,11 @@ "conventional-commits-filter": "^2.0.6", "conventional-commits-parser": "^3.1.0", "git-raw-commits": "2.0.0", - "git-semver-tags": "^4.0.0", + "git-semver-tags": "^4.1.0", "meow": "^7.0.0", "q": "^1.5.1" }, "dependencies": { - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -4858,13 +4808,13 @@ } }, "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", "dev": true, "requires": { "bn.js": "^4.1.0", - "elliptic": "^6.0.0" + "elliptic": "^6.5.3" }, "dependencies": { "bn.js": { @@ -5029,6 +4979,12 @@ "semver": "^7.3.2" }, "dependencies": { + "camelcase": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz", + "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==", + "dev": true + }, "loader-utils": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", @@ -5704,9 +5660,9 @@ } }, "electron-to-chromium": { - "version": "1.3.516", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.516.tgz", - "integrity": "sha512-WDM5AAQdOrvLqSX8g3Zd5AujBXfMxf96oeZkff0U2HF5op3tjShE+on2yay3r1UD4M9I3p0iHpAS4+yV8U8A9A==" + "version": "1.3.544", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.544.tgz", + "integrity": "sha512-jx6H7M1db76Q/dI3MadZC4qwNTvpiq8tdYEJswxexrIm5bH+LKRdg+VAteMF1tJJbBLrcuogE9N3nxT3Dp1gag==" }, "elliptic": { "version": "6.5.3", @@ -5905,9 +5861,9 @@ } }, "eslint": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.6.0.tgz", - "integrity": "sha512-QlAManNtqr7sozWm5TF4wIH9gmUm2hE3vNRUvyoYAa4y1l5/jxD/PQStEjBMQtCqZmSep8UxrcecI60hOpe61w==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz", + "integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -6355,12 +6311,12 @@ "dev": true }, "espree": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", - "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", + "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", "dev": true, "requires": { - "acorn": "^7.3.1", + "acorn": "^7.4.0", "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.3.0" } @@ -6380,9 +6336,9 @@ }, "dependencies": { "estraverse": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", - "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", "dev": true } } @@ -6487,15 +6443,15 @@ } }, "expect": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.3.0.tgz", - "integrity": "sha512-3tC0dpPgkTGkycM9H+mMjzIhm8I3ZAOV+y1Cj3xmF9iKxDeHBCAB64hf1OY//bMzQ/AftfodNy2pQWMKpTIV8Q==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.4.2.tgz", + "integrity": "sha512-IlJ3X52Z0lDHm7gjEp+m76uX46ldH5VpqmU0006vqDju/285twh7zaWMRhs67VpQhBwjjMchk+p5aA0VkERCAA==", "dev": true, "requires": { "@jest/types": "^26.3.0", "ansi-styles": "^4.0.0", "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.3.0", + "jest-matcher-utils": "^26.4.2", "jest-message-util": "^26.3.0", "jest-regex-util": "^26.0.0" }, @@ -7369,9 +7325,9 @@ } }, "git-semver-tags": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.0.0.tgz", - "integrity": "sha512-LajaAWLYVBff+1NVircURJFL8TQ3EMIcLAfHisWYX/nPoMwnTYfWAznQDmMujlLqoD12VtLmoSrF1sQ5MhimEQ==", + "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==", "dev": true, "requires": { "meow": "^7.0.0", @@ -7803,14 +7759,14 @@ } }, "parse-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", - "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", + "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-better-errors": "^1.0.1", + "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, @@ -8082,9 +8038,9 @@ "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=" }, "is-docker": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.0.0.tgz", - "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", + "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", "dev": true, "optional": true }, @@ -8186,9 +8142,9 @@ "dev": true }, "is-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", - "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "requires": { "has-symbols": "^1.0.1" } @@ -8378,14 +8334,14 @@ } }, "jest": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.3.0.tgz", - "integrity": "sha512-LFCry7NS6bTa4BUGUHC+NvZ3B9WG7Jv8F+Lb96dAJFM23LMwSsL5RiJcw9S+nejsh8lS1VxHq+RSH4Xa9tujpA==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest/-/jest-26.4.2.tgz", + "integrity": "sha512-LLCjPrUh98Ik8CzW8LLVnSCfLaiY+wbK53U7VxnFSX7Q+kWC4noVeDvGWIFw0Amfq1lq2VfGm7YHWSLBV62MJw==", "dev": true, "requires": { - "@jest/core": "^26.3.0", + "@jest/core": "^26.4.2", "import-local": "^3.0.2", - "jest-cli": "^26.3.0" + "jest-cli": "^26.4.2" }, "dependencies": { "ansi-styles": { @@ -8430,12 +8386,12 @@ "dev": true }, "jest-cli": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.3.0.tgz", - "integrity": "sha512-vrlDluEjnNTJNpmw+lJ1Dvjhc+2o7QG0dG8n+iDu3NaoQ9OzqNeZsZZ0a9KP7SdtD5BXgvGSpCWTlLH5SqtxcA==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.4.2.tgz", + "integrity": "sha512-zb+lGd/SfrPvoRSC/0LWdaWCnscXc1mGYW//NP4/tmBvRPT3VntZ2jtKUONsRi59zc5JqmsSajA9ewJKFYp8Cw==", "dev": true, "requires": { - "@jest/core": "^26.3.0", + "@jest/core": "^26.4.2", "@jest/test-result": "^26.3.0", "@jest/types": "^26.3.0", "chalk": "^4.0.0", @@ -8443,9 +8399,9 @@ "graceful-fs": "^4.2.4", "import-local": "^3.0.2", "is-ci": "^2.0.0", - "jest-config": "^26.3.0", + "jest-config": "^26.4.2", "jest-util": "^26.3.0", - "jest-validate": "^26.3.0", + "jest-validate": "^26.4.2", "prompts": "^2.0.1", "yargs": "^15.3.1" } @@ -8501,9 +8457,9 @@ } }, "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, "requires": { "pump": "^3.0.0" @@ -8557,13 +8513,13 @@ } }, "jest-config": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.3.0.tgz", - "integrity": "sha512-xzvmhKYOXOc/JjGabUUXoi7Nxu6QpY5zJxND85wdqFrdP7raJT5wqlrVJbp6Bv4Sj1e83Z8bkxjsZCpwPASaPw==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.4.2.tgz", + "integrity": "sha512-QBf7YGLuToiM8PmTnJEdRxyYy3mHWLh24LJZKVdXZ2PNdizSe1B/E8bVm+HYcjbEzGuVXDv/di+EzdO/6Gq80A==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.3.0", + "@jest/test-sequencer": "^26.4.2", "@jest/types": "^26.3.0", "babel-jest": "^26.3.0", "chalk": "^4.0.0", @@ -8573,13 +8529,13 @@ "jest-environment-jsdom": "^26.3.0", "jest-environment-node": "^26.3.0", "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.3.0", + "jest-jasmine2": "^26.4.2", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.3.0", + "jest-resolve": "^26.4.0", "jest-util": "^26.3.0", - "jest-validate": "^26.3.0", + "jest-validate": "^26.4.2", "micromatch": "^4.0.2", - "pretty-format": "^26.3.0" + "pretty-format": "^26.4.2" }, "dependencies": { "ansi-styles": { @@ -8678,15 +8634,15 @@ } }, "jest-diff": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.3.0.tgz", - "integrity": "sha512-q5OZAtnr5CbHzrhjANzc3wvROk7+rcjCUI5uqM4cjOjtscNKfbJKBs3YhsWWhsdsIZzI3gc6wOpm49r6S61beg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.4.2.tgz", + "integrity": "sha512-6T1XQY8U28WH0Z5rGpQ+VqZSZz8EN8rZcBtfvXaOkbwxIEeRre6qnuZQlbY1AJ4MKDxQF8EkrCvK+hL/VkyYLQ==", "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^26.3.0", "jest-get-type": "^26.3.0", - "pretty-format": "^26.3.0" + "pretty-format": "^26.4.2" }, "dependencies": { "ansi-styles": { @@ -8751,16 +8707,16 @@ } }, "jest-each": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.3.0.tgz", - "integrity": "sha512-OSAnLv0Eo/sDVhV0ifT2u6Q4aYUBoZ97R4k9cQshUFLTco0iRDbViJiW3Y6ySZjW95Tb83/xMYCppBih/7sW/A==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.4.2.tgz", + "integrity": "sha512-p15rt8r8cUcRY0Mvo1fpkOGYm7iI8S6ySxgIdfh3oOIv+gHwrHTy5VWCGOecWUhDsit4Nz8avJWdT07WLpbwDA==", "dev": true, "requires": { "@jest/types": "^26.3.0", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", "jest-util": "^26.3.0", - "pretty-format": "^26.3.0" + "pretty-format": "^26.4.2" }, "dependencies": { "ansi-styles": { @@ -8935,9 +8891,9 @@ } }, "jest-jasmine2": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.3.0.tgz", - "integrity": "sha512-ZPkkA2XfH/fcLOp0SjeR4uDrMoNFilcwxLHORpjfMrcU0BFHNNRaF3DnslCdmewzqaERqtmHpYo8jj34RT+m2g==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.4.2.tgz", + "integrity": "sha512-z7H4EpCldHN1J8fNgsja58QftxBSL+JcwZmaXIvV9WKIM+x49F4GLHu/+BQh2kzRKHAgaN/E82od+8rTOBPyPA==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", @@ -8948,15 +8904,15 @@ "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "expect": "^26.3.0", + "expect": "^26.4.2", "is-generator-fn": "^2.0.0", - "jest-each": "^26.3.0", - "jest-matcher-utils": "^26.3.0", + "jest-each": "^26.4.2", + "jest-matcher-utils": "^26.4.2", "jest-message-util": "^26.3.0", - "jest-runtime": "^26.3.0", - "jest-snapshot": "^26.3.0", + "jest-runtime": "^26.4.2", + "jest-snapshot": "^26.4.2", "jest-util": "^26.3.0", - "pretty-format": "^26.3.0", + "pretty-format": "^26.4.2", "throat": "^5.0.0" }, "dependencies": { @@ -9048,25 +9004,25 @@ } }, "jest-leak-detector": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.3.0.tgz", - "integrity": "sha512-8C2Bur0S6n2xgW5kx22bDbe+Jjz9sM7/abr7DRQ48ww6q4w7vVzEpDEZiY7KatjTHtUloLTAqwTXEXg+tuETTg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.4.2.tgz", + "integrity": "sha512-akzGcxwxtE+9ZJZRW+M2o+nTNnmQZxrHJxX/HjgDaU5+PLmY1qnQPnMjgADPGCRPhB+Yawe1iij0REe+k/aHoA==", "dev": true, "requires": { "jest-get-type": "^26.3.0", - "pretty-format": "^26.3.0" + "pretty-format": "^26.4.2" } }, "jest-matcher-utils": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.3.0.tgz", - "integrity": "sha512-M5ZRSp6qpyzZyrLwXD2Sop7xaxm6qu/mKvqWU+BOSPTa4Y0ZEoKUYBzus/emg6kaVt7Ov9xMDLLZR1SrC8FxCw==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.4.2.tgz", + "integrity": "sha512-KcbNqWfWUG24R7tu9WcAOKKdiXiXCbMvQYT6iodZ9k1f7065k0keUOW6XpJMMvah+hTfqkhJhRXmA3r3zMAg0Q==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^26.3.0", + "jest-diff": "^26.4.2", "jest-get-type": "^26.3.0", - "pretty-format": "^26.3.0" + "pretty-format": "^26.4.2" }, "dependencies": { "ansi-styles": { @@ -9261,9 +9217,9 @@ "dev": true }, "jest-resolve": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.3.0.tgz", - "integrity": "sha512-+oKVWDkXjdZ4Xciuxv+M5e5v/Z3RLjrKIzen9tq3IO6HpzsLf9Mk3rET5du1uU8iVUCvz4/1PmjzNF50Uc7l2A==", + "version": "26.4.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.4.0.tgz", + "integrity": "sha512-bn/JoZTEXRSlEx3+SfgZcJAVuTMOksYq9xe9O6s4Ekg84aKBObEaVXKOEilULRqviSLAYJldnoWV9c07kwtiCg==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -9335,20 +9291,20 @@ } }, "jest-resolve-dependencies": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.3.0.tgz", - "integrity": "sha512-j5rZ2BUh8vVjJZ7bpgCre0t6mbFLm5BWfVhYb1H35A3nbPN3kepzMqkMnKXPhwyLIVwn25uYkv6LHc2/Xa1sGw==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.4.2.tgz", + "integrity": "sha512-ADHaOwqEcVc71uTfySzSowA/RdxUpCxhxa2FNLiin9vWLB1uLPad3we+JSSROq5+SrL9iYPdZZF8bdKM7XABTQ==", "dev": true, "requires": { "@jest/types": "^26.3.0", "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.3.0" + "jest-snapshot": "^26.4.2" } }, "jest-runner": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.3.0.tgz", - "integrity": "sha512-eiPKgbhTM4q6A7RBh4qzKf6hwFDJMfqoFJubFvWSrHdZUsvSiBWYDqQI+FUXDFxDAOn/AfZjKURACAH3fUDjwA==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.4.2.tgz", + "integrity": "sha512-FgjDHeVknDjw1gRAYaoUoShe1K3XUuFMkIaXbdhEys+1O4bEJS8Avmn4lBwoMfL8O5oFTdWYKcf3tEJyyYyk8g==", "dev": true, "requires": { "@jest/console": "^26.3.0", @@ -9360,13 +9316,13 @@ "emittery": "^0.7.1", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-config": "^26.3.0", + "jest-config": "^26.4.2", "jest-docblock": "^26.0.0", "jest-haste-map": "^26.3.0", - "jest-leak-detector": "^26.3.0", + "jest-leak-detector": "^26.4.2", "jest-message-util": "^26.3.0", - "jest-resolve": "^26.3.0", - "jest-runtime": "^26.3.0", + "jest-resolve": "^26.4.0", + "jest-runtime": "^26.4.2", "jest-util": "^26.3.0", "jest-worker": "^26.3.0", "source-map-support": "^0.5.6", @@ -9426,15 +9382,15 @@ } }, "jest-runtime": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.3.0.tgz", - "integrity": "sha512-cqCz+S76qwZcPnddkLCjuNw9O8/lB+i1odjz2hpvpDogXLp0qSMs+Slh1gBjB5V4feUyBHav/550Mr3FeTdmnA==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.4.2.tgz", + "integrity": "sha512-4Pe7Uk5a80FnbHwSOk7ojNCJvz3Ks2CNQWT5Z7MJo4tX0jb3V/LThKvD9tKPNVNyeMH98J/nzGlcwc00R2dSHQ==", "dev": true, "requires": { "@jest/console": "^26.3.0", "@jest/environment": "^26.3.0", "@jest/fake-timers": "^26.3.0", - "@jest/globals": "^26.3.0", + "@jest/globals": "^26.4.2", "@jest/source-map": "^26.3.0", "@jest/test-result": "^26.3.0", "@jest/transform": "^26.3.0", @@ -9445,15 +9401,15 @@ "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.2.4", - "jest-config": "^26.3.0", + "jest-config": "^26.4.2", "jest-haste-map": "^26.3.0", "jest-message-util": "^26.3.0", "jest-mock": "^26.3.0", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.3.0", - "jest-snapshot": "^26.3.0", + "jest-resolve": "^26.4.0", + "jest-snapshot": "^26.4.2", "jest-util": "^26.3.0", - "jest-validate": "^26.3.0", + "jest-validate": "^26.4.2", "slash": "^3.0.0", "strip-bom": "^4.0.0", "yargs": "^15.3.1" @@ -9534,25 +9490,25 @@ } }, "jest-snapshot": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.3.0.tgz", - "integrity": "sha512-tHVUIeOTN/0SZN2ZjBZHzPG5txs/6uEQx2mwjxIT7QRE7pddPLd8jktXthyIz6bV+3GKetWXSV4YAoPUQwrfMA==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.4.2.tgz", + "integrity": "sha512-N6Uub8FccKlf5SBFnL2Ri/xofbaA68Cc3MGjP/NuwgnsvWh+9hLIR/DhrxbSiKXMY9vUW5dI6EW1eHaDHqe9sg==", "dev": true, "requires": { "@babel/types": "^7.0.0", "@jest/types": "^26.3.0", "@types/prettier": "^2.0.0", "chalk": "^4.0.0", - "expect": "^26.3.0", + "expect": "^26.4.2", "graceful-fs": "^4.2.4", - "jest-diff": "^26.3.0", + "jest-diff": "^26.4.2", "jest-get-type": "^26.3.0", "jest-haste-map": "^26.3.0", - "jest-matcher-utils": "^26.3.0", + "jest-matcher-utils": "^26.4.2", "jest-message-util": "^26.3.0", - "jest-resolve": "^26.3.0", + "jest-resolve": "^26.4.0", "natural-compare": "^1.4.0", - "pretty-format": "^26.3.0", + "pretty-format": "^26.4.2", "semver": "^7.3.2" }, "dependencies": { @@ -9724,9 +9680,9 @@ } }, "jest-validate": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.3.0.tgz", - "integrity": "sha512-oIJWqkIdgh1Q1O7ku4kDGkQoFKUOtZyDMbfYs4DsBi6r+FDY37xKTyZ30nM8F6yGZfB72qc7XB+3qKRgokwoXg==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.4.2.tgz", + "integrity": "sha512-blft+xDX7XXghfhY0mrsBCYhX365n8K5wNDC4XAcNKqqjEzsRUSXP44m6PL0QJEW2crxQFLLztVnJ4j7oPlQrQ==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -9734,7 +9690,7 @@ "chalk": "^4.0.0", "jest-get-type": "^26.3.0", "leven": "^3.1.0", - "pretty-format": "^26.3.0" + "pretty-format": "^26.4.2" }, "dependencies": { "ansi-styles": { @@ -9747,6 +9703,12 @@ "color-convert": "^2.0.1" } }, + "camelcase": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz", + "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==", + "dev": true + }, "chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", @@ -9882,9 +9844,9 @@ } }, "js-base64": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.3.tgz", - "integrity": "sha512-fiUvdfCaAXoQTHdKMgTvg6IkecXDcVz6V5rlftUTclF9IKBjMizvSdQaCl/z/6TApDeby5NL+axYou3i0mu1Pg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", "dev": true }, "js-tokens": { @@ -9953,6 +9915,12 @@ "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, + "json-parse-even-better-errors": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.0.tgz", + "integrity": "sha512-o3aP+RsWDJZayj1SbHNQAI8x0v3T3SKiGoZlNYfbUP1S3omJQ6i9CnqADqkSPaOAxwua4/1YWx5CM7oiChJt2Q==", + "dev": true + }, "json-parser": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/json-parser/-/json-parser-1.1.5.tgz", @@ -10211,9 +10179,9 @@ } }, "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, "requires": { "pump": "^3.0.0" @@ -10273,14 +10241,14 @@ } }, "parse-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", - "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", + "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-better-errors": "^1.0.1", + "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, @@ -10347,9 +10315,9 @@ "dev": true }, "listr2": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.4.1.tgz", - "integrity": "sha512-8pYsCZCztr5+KAjReLyBeGhLV0vaQ2Du/eMe/ux9QAfQl7efiWejM1IWjALh0zHIRYuIbhQ8N2KztZ4ci56pnQ==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.0.tgz", + "integrity": "sha512-nwmqTJYQQ+AsKb4fCXH/6/UmLCEDL1jkRAdSn9M6cEUzoRGrs33YD/3N86gAZQnGZ6hxV18XSdlBcJ1GTmetJA==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -10358,7 +10326,7 @@ "indent-string": "^4.0.0", "log-update": "^4.0.0", "p-map": "^4.0.0", - "rxjs": "^6.6.0", + "rxjs": "^6.6.2", "through": "^2.3.8" }, "dependencies": { @@ -10480,9 +10448,9 @@ } }, "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "lodash._reinterpolate": { @@ -10756,18 +10724,16 @@ "dev": true }, "meow": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-7.0.1.tgz", - "integrity": "sha512-tBKIQqVrAHqwit0vfuFPY3LlzJYkEOFyKa3bPgxzNl6q/RtN8KQ+ALYEASYuFayzSAsjlhXj/JZ10rH85Q6TUw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.0.tgz", + "integrity": "sha512-kq5F0KVteskZ3JdfyQFivJEj2RaA8NFsS4+r9DaMKLcUHpk5OcHS3Q0XkCXONB1mZRPsu/Y/qImKri0nwSEZog==", "dev": true, "requires": { "@types/minimist": "^1.2.0", - "arrify": "^2.0.1", - "camelcase": "^6.0.0", "camelcase-keys": "^6.2.2", "decamelize-keys": "^1.1.0", "hard-rejection": "^2.1.0", - "minimist-options": "^4.0.2", + "minimist-options": "4.1.0", "normalize-package-data": "^2.5.0", "read-pkg-up": "^7.0.1", "redent": "^3.0.0", @@ -10854,9 +10820,9 @@ "dev": true }, "mini-css-extract-plugin": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz", - "integrity": "sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.10.0.tgz", + "integrity": "sha512-QgKgJBjaJhxVPwrLNqqwNS0AGkuQQ31Hp4xGXEK/P7wehEg6qmNtReHKai3zRXqY60wGVWLYcOMJK2b98aGc3A==", "dev": true, "requires": { "loader-utils": "^1.1.0", @@ -10924,14 +10890,6 @@ "arrify": "^1.0.1", "is-plain-obj": "^1.1.0", "kind-of": "^6.0.3" - }, - "dependencies": { - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - } } }, "minipass": { @@ -10967,9 +10925,9 @@ } }, "minizlib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.0.tgz", - "integrity": "sha512-EzTZN/fjSvifSX0SlqUERCN39o6T40AMarPbv0MrarSFtIITCBh7bi+dU8nxGFHuqs9jdIAeoYoKuQAAASsPPA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "requires": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -11329,9 +11287,9 @@ "dev": true }, "node-notifier": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-7.0.2.tgz", - "integrity": "sha512-ux+n4hPVETuTL8+daJXTOC6uKLgMsl1RYfFv7DKRzyvzBapqco0rZZ9g72ZN8VS6V+gvNYHYa/ofcCY8fkJWsA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.0.tgz", + "integrity": "sha512-46z7DUmcjoYdaWyXouuFNNfUo6eFa94t23c53c+lG/9Cvauk4a98rAUp9672X5dxGdQmLpPzTxzu8f/OeEPaFA==", "dev": true, "optional": true, "requires": { @@ -11339,7 +11297,7 @@ "is-wsl": "^2.2.0", "semver": "^7.3.2", "shellwords": "^0.1.1", - "uuid": "^8.2.0", + "uuid": "^8.3.0", "which": "^2.0.2" }, "dependencies": { @@ -11892,9 +11850,9 @@ } }, "onetime": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", - "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "requires": { "mimic-fn": "^2.1.0" @@ -12034,14 +11992,13 @@ } }, "parse-asn1": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", - "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", "dev": true, "requires": { - "asn1.js": "^4.0.0", + "asn1.js": "^5.2.0", "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", "evp_bytestokey": "^1.0.0", "pbkdf2": "^3.0.3", "safe-buffer": "^5.1.1" @@ -12245,9 +12202,9 @@ } }, "postcss-calc": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.2.tgz", - "integrity": "sha512-rofZFHUg6ZIrvRwPeFktv06GdbDYLcGqh9EwiMutZg+a0oePCCw1zHOEiji6LCpyRcjTREtPASuUqeAvYlEVvQ==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.3.tgz", + "integrity": "sha512-IB/EAEmZhIMEIhG7Ov4x+l47UaXOS1n2f4FBUk/aKllQhtSCxWhTzn0nJgkqN7fo/jcWySvWTSB6Syk9L+31bA==", "requires": { "postcss": "^7.0.27", "postcss-selector-parser": "^6.0.2", @@ -12730,15 +12687,15 @@ "dev": true }, "prettier": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", - "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.0.tgz", + "integrity": "sha512-lz28cCbA1cDFHVuY8vvj6QuqOwIpyIfPUYkSl8AZ/vxH8qBXMMjE2knfLHCrZCmUsK/H1bg1P0tOo0dJkTJHvw==", "dev": true }, "pretty-format": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.3.0.tgz", - "integrity": "sha512-24kRw4C2Ok8+SHquydTZZCZPF2fvANI7rChGs8sNu784+1Jkq5jVFMvNAJSLuLy6XUcP3Fnw+SscLIQag/CG8Q==", + "version": "26.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.4.2.tgz", + "integrity": "sha512-zK6Gd8zDsEiVydOCGLkoBoZuqv8VTiHyAbKznXe/gaph/DAeZOmit9yMfgIz5adIgAMMs5XfoYSwAX3jcCO1tA==", "dev": true, "requires": { "@jest/types": "^26.3.0", @@ -12990,14 +12947,14 @@ }, "dependencies": { "parse-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", - "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", + "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-better-errors": "^1.0.1", + "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, @@ -13418,9 +13375,9 @@ } }, "rxjs": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.0.tgz", - "integrity": "sha512-3HMA8z/Oz61DUHe+SdOiQyzIf4tOx5oQHmMir7IZEu6TMqCLHT4LRcmNaUS0NwOz8VLvmmBduMsoaUvMaIiqzg==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz", + "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -13481,12 +13438,6 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, "cliui": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", @@ -14158,16 +14109,16 @@ } }, "standard-version": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-8.0.2.tgz", - "integrity": "sha512-L8X9KFq2SmVmaeZgUmWHFJMOsEWpjgFAwqic6yIIoveM1kdw1vH4Io03WWxUDjypjGqGU6qUtcJoR8UvOv5w3g==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-9.0.0.tgz", + "integrity": "sha512-eRR04IscMP3xW9MJTykwz13HFNYs8jS33AGuDiBKgfo5YrO0qX0Nxb4rjupVwT5HDYL/aR+MBEVLjlmVFmFEDQ==", "dev": true, "requires": { "chalk": "^2.4.2", - "conventional-changelog": "3.1.21", + "conventional-changelog": "3.1.23", "conventional-changelog-config-spec": "2.1.0", - "conventional-changelog-conventionalcommits": "4.3.0", - "conventional-recommended-bump": "6.0.9", + "conventional-changelog-conventionalcommits": "4.4.0", + "conventional-recommended-bump": "6.0.10", "detect-indent": "^6.0.0", "detect-newline": "^3.1.0", "dotgitignore": "^2.1.0", @@ -14566,14 +14517,14 @@ "dev": true }, "tar": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.2.tgz", - "integrity": "sha512-Glo3jkRtPcvpDlAs/0+hozav78yoXKFr+c4wgw62NNMO3oo4AaJdCo21Uu7lcwr55h39W2XD1LMERc64wtbItg==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.0.5.tgz", + "integrity": "sha512-0b4HOimQHj9nXNEAA7zWwMM91Zhhba3pspja6sQbgTpynOJf+bkjBnfybNYzbpLbnwXnbyB4LOREvlyXLkCHSg==", "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^3.0.0", - "minizlib": "^2.1.0", + "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" } @@ -14608,16 +14559,16 @@ } }, "terser-webpack-plugin": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.4.tgz", - "integrity": "sha512-U4mACBHIegmfoEe5fdongHESNJWqsGU+W0S/9+BmYGVQDw1+c2Ow05TpMhxjPK1sRb7cuYq1BPl1e5YHJMTCqA==", + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", + "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", "dev": true, "requires": { "cacache": "^12.0.2", "find-cache-dir": "^2.1.0", "is-wsl": "^1.1.0", "schema-utils": "^1.0.0", - "serialize-javascript": "^3.1.0", + "serialize-javascript": "^4.0.0", "source-map": "^0.6.1", "terser": "^4.1.2", "webpack-sources": "^1.4.0", @@ -14776,15 +14727,6 @@ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, - "serialize-javascript": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz", - "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, "ssri": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", @@ -15049,9 +14991,9 @@ } }, "uglify-js": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", - "integrity": "sha512-Esj5HG5WAyrLIdYU74Z3JdG2PxdIusvj6IWHMtlyESxc7kcDz7zYlYjpnSokn1UbpV0d/QX9fan7gkCNd/9BQA==", + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.2.tgz", + "integrity": "sha512-GXCYNwqoo0MbLARghYjxVBxDCnU0tLqN7IPLdHHbibCb1NI5zBkU2EPcy/GaVxc0BtTjqyGXJCINe6JMR2Dpow==", "dev": true, "optional": true }, @@ -15392,9 +15334,9 @@ } }, "chokidar": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz", - "integrity": "sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", + "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", "dev": true, "optional": true, "requires": { @@ -15844,14 +15786,6 @@ "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 - } } } } diff --git a/package.json b/package.json index 4dff68f..66a4c29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "css-minimizer-webpack-plugin", - "version": "1.1.1", + "version": "1.1.2", "description": "cssnano plugin for Webpack", "license": "MIT", "repository": "webpack-contrib/css-minimizer-webpack-plugin", @@ -53,10 +53,10 @@ }, "devDependencies": { "@babel/cli": "^7.10.5", - "@babel/core": "^7.11.1", + "@babel/core": "^7.11.4", "@babel/preset-env": "^7.11.0", "@commitlint/cli": "^9.1.2", - "@commitlint/config-conventional": "^9.1.1", + "@commitlint/config-conventional": "^10.0.0", "@webpack-contrib/defaults": "^6.3.0", "@webpack-contrib/eslint-config-webpack": "^3.0.0", "babel-jest": "^26.3.0", @@ -66,21 +66,21 @@ "css-loader": "^4.2.1", "del": "^5.1.0", "del-cli": "^3.0.1", - "eslint": "^7.5.0", + "eslint": "^7.7.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-import": "^2.22.0", "husky": "^4.2.5", - "jest": "^26.3.0", + "jest": "^26.4.2", "jest-junit": "^11.0.1", "lint-staged": "^10.2.11", "memfs": "^3.2.0", - "mini-css-extract-plugin": "^0.9.0", + "mini-css-extract-plugin": "^0.10.0", "node-sass": "^4.14.1", "npm-run-all": "^4.1.5", "postcss": "^7.0.32", - "prettier": "^2.0.5", + "prettier": "^2.1.0", "sass-loader": "^9.0.3", - "standard-version": "^8.0.2", + "standard-version": "^9.0.0", "webpack": "^4.44.1" }, "keywords": [ diff --git a/src/Webpack4Cache.js b/src/Webpack4Cache.js index 121cfe9..99936a3 100644 --- a/src/Webpack4Cache.js +++ b/src/Webpack4Cache.js @@ -5,11 +5,12 @@ import findCacheDir from 'find-cache-dir'; import serialize from 'serialize-javascript'; export default class Webpack4Cache { - constructor(compilation, options) { - this.cacheDir = + constructor(compilation, options, weakCache) { + this.cache = options.cache === true ? Webpack4Cache.getCacheDirectory() : options.cache; + this.weakCache = weakCache; } static getCacheDirectory() { @@ -18,20 +19,72 @@ export default class Webpack4Cache { ); } - isEnabled() { - return Boolean(this.cacheDir); - } + async get(task, sources) { + const weakOutput = this.weakCache.get(task.assetSource); + + if (weakOutput) { + return weakOutput; + } + + if (!this.cache) { + // eslint-disable-next-line no-undefined + return undefined; + } - async get(task) { // eslint-disable-next-line no-param-reassign task.cacheIdent = task.cacheIdent || serialize(task.cacheKeys); - const { data } = await cacache.get(this.cacheDir, task.cacheIdent); + let cachedResult; + + try { + cachedResult = await cacache.get(this.cache, task.cacheIdent); + } catch (ignoreError) { + // eslint-disable-next-line no-undefined + return undefined; + } + + cachedResult = JSON.parse(cachedResult.data); + + const { css: code, map, input, assetName, inputSourceMap } = cachedResult; - return JSON.parse(data); + if (map) { + cachedResult.source = new sources.SourceMapSource( + code, + assetName, + map, + input, + inputSourceMap, + true + ); + } else { + cachedResult.source = new sources.RawSource(code); + } + + return cachedResult; } - async store(task, data) { - return cacache.put(this.cacheDir, task.cacheIdent, JSON.stringify(data)); + async store(task) { + if (!this.weakCache.has(task.assetSource)) { + this.weakCache.set(task.assetSource, task); + } + + if (!this.cache) { + // eslint-disable-next-line no-undefined + return undefined; + } + + const { cacheIdent, css, assetName, map, input, inputSourceMap } = task; + + return cacache.put( + this.cache, + cacheIdent, + JSON.stringify({ + assetName, + css, + map, + input, + inputSourceMap, + }) + ); } } diff --git a/src/Webpack5Cache.js b/src/Webpack5Cache.js index 2ed3841..568deb2 100644 --- a/src/Webpack5Cache.js +++ b/src/Webpack5Cache.js @@ -1,26 +1,22 @@ export default class Cache { // eslint-disable-next-line no-unused-vars - constructor(compilation, ignored) { + constructor(compilation) { this.cache = compilation.getCache('CssMinimizerWebpackPlugin'); } - // eslint-disable-next-line class-methods-use-this - isEnabled() { - return true; - } - async get(task) { // eslint-disable-next-line no-param-reassign - task.cacheIdent = task.cacheIdent || `${task.name}`; + task.eTag = task.eTag || this.cache.getLazyHashedEtag(task.assetSource); - // eslint-disable-next-line no-param-reassign - task.cacheETag = - task.cacheETag || this.cache.getLazyHashedEtag(task.assetSource); - - return this.cache.getPromise(task.cacheIdent, task.cacheETag); + return this.cache.getPromise(task.assetName, task.eTag); } - async store(task, data) { - return this.cache.storePromise(task.cacheIdent, task.cacheETag, data); + async store(task) { + const { source, warnings } = task; + + return this.cache.storePromise(task.assetName, task.eTag, { + source, + warnings, + }); } } diff --git a/src/index.js b/src/index.js index 7765157..5618096 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,9 @@ import os from 'os'; +import crypto from 'crypto'; import { SourceMapConsumer } from 'source-map'; -import { SourceMapSource, RawSource } from 'webpack-sources'; import RequestShortener from 'webpack/lib/RequestShortener'; -import { - util, +import webpack, { ModuleFilenameHelpers, SourceMapDevToolPlugin, version as webpackVersion, @@ -21,6 +20,11 @@ import { minify as minifyFn } from './minify'; const warningRegex = /\s.+:+([0-9]+):+([0-9]+)/; +// webpack 5 exposes the sources property to ensure the right version of webpack-sources is used +const { SourceMapSource, RawSource } = + // eslint-disable-next-line global-require + webpack.sources || require('webpack-sources'); + class CssMinimizerPlugin { constructor(options = {}) { validateOptions(schema, options, { @@ -157,10 +161,6 @@ class CssMinimizerPlugin { return `Css Minimizer Plugin: ${warningMessage} ${locationMessage}`; } - static isWebpack4() { - return webpackVersion[0] === '4'; - } - static getAvailableNumberOfCores(parallel) { // In some cases cpus() returns undefined // https://github.com/nodejs/node/issues/19022 @@ -193,14 +193,14 @@ class CssMinimizerPlugin { compilation.assets[name] = newSource; } - *taskGenerator(compiler, compilation, name) { - const { info, source: assetSource } = CssMinimizerPlugin.getAsset( - compilation, - name - ); + *getTask(compiler, compilation, assetName) { + const { + info: assetInfo, + source: assetSource, + } = CssMinimizerPlugin.getAsset(compilation, assetName); // Skip double minimize assets from child compilation - if (info.minimized) { + if (assetInfo.minimized) { yield false; } @@ -220,7 +220,7 @@ class CssMinimizerPlugin { inputSourceMap = map; compilation.warnings.push( - new Error(`${name} contains invalid source map`) + new Error(`${assetName} contains invalid source map`) ); } } @@ -233,119 +233,45 @@ class CssMinimizerPlugin { input = input.toString(); } - const callback = (taskResult) => { - const { css: code, error, map, warnings } = taskResult; - - let sourceMap = null; - - if ( - (error || (warnings && warnings.length > 0)) && - inputSourceMap && - CssMinimizerPlugin.isSourceMap(inputSourceMap) - ) { - sourceMap = new SourceMapConsumer(inputSourceMap); - } - - // Handling results - // Error case: add errors, and go to next file - if (error) { - compilation.errors.push( - CssMinimizerPlugin.buildError( - error, - name, - sourceMap, - new RequestShortener(compiler.context) - ) - ); - - return; - } - - let outputSource; - - if (map) { - outputSource = new SourceMapSource( - code, - name, - map, - input, - inputSourceMap, - true - ); - } else { - outputSource = new RawSource(code); - } - - CssMinimizerPlugin.updateAsset(compilation, name, outputSource, { - ...info, - minimized: true, - }); - - // Handling warnings - if (warnings && warnings.length > 0) { - warnings.forEach((warning) => { - const builtWarning = CssMinimizerPlugin.buildWarning( - warning, - name, - sourceMap, - new RequestShortener(compiler.context), - this.options.warningsFilter - ); - - if (builtWarning) { - compilation.warnings.push(builtWarning); - } - }); - } - }; - const task = { - name, + assetName, + assetSource, + assetInfo, input, inputSourceMap, map: this.options.sourceMap, minimizerOptions: this.options.minimizerOptions, minify: this.options.minify, - callback, }; if (CssMinimizerPlugin.isWebpack4()) { - const { - outputOptions: { hashSalt, hashDigest, hashDigestLength, hashFunction }, - } = compilation; - const hash = util.createHash(hashFunction); - - if (hashSalt) { - hash.update(hashSalt); - } - - hash.update(input); - - const digest = hash.digest(hashDigest); - if (this.options.cache) { const defaultCacheKeys = { - cssMinimizer: CssMinimizerPackageJson.version, + nodeVersion: process.version, // eslint-disable-next-line global-require 'css-minimizer-webpack-plugin': require('../package.json').version, + cssMinimizer: CssMinimizerPackageJson.version, 'css-minimizer-webpack-plugin-options': this.options, - nodeVersion: process.version, - filename: name, - contentHash: digest.substr(0, hashDigestLength), + assetName, + contentHash: crypto.createHash('md4').update(input).digest('hex'), }; - task.cacheKeys = this.options.cacheKeys(defaultCacheKeys, name); + task.cacheKeys = this.options.cacheKeys(defaultCacheKeys, assetName); } - } else { - // For webpack@5 cache - task.assetSource = assetSource; } yield task; } // eslint-disable-next-line class-methods-use-this - async runTasks(assetNames, getTaskForAsset, cache) { + async runTasks(compiler, compilation, assetNames, CacheEngine, weakCache) { + const cache = new CacheEngine( + compilation, + { + cache: this.options.cache, + }, + weakCache + ); const availableNumberOfCores = CssMinimizerPlugin.getAvailableNumberOfCores( this.options.parallel ); @@ -383,57 +309,92 @@ class CssMinimizerPlugin { const scheduledTasks = []; for (const assetName of assetNames) { - const enqueue = async (task) => { - let taskResult; - - try { - if (worker) { - taskResult = await worker.transform(serialize(task)); - } else { - taskResult = await minifyFn(task); - } - } catch (error) { - taskResult = { error }; - } - - if (cache.isEnabled() && !taskResult.error) { - await cache.store(task, taskResult); - } - - task.callback(taskResult); - - return taskResult; - }; - scheduledTasks.push( limit(async () => { - const task = getTaskForAsset(assetName).next().value; + const task = this.getTask(compiler, compilation, assetName).next() + .value; if (!task) { - // Something went wrong, for example the `cacheKeys` option throw an error return Promise.resolve(); } - if (cache.isEnabled()) { - let taskResult; + let resultOutput = await cache.get(task, { + RawSource, + SourceMapSource, + }); + if (!resultOutput) { try { - taskResult = await cache.get(task); - } catch (ignoreError) { - return enqueue(task); + // eslint-disable-next-line no-param-reassign + resultOutput = await (worker + ? worker.transform(serialize(task)) + : minifyFn(task)); + } catch (error) { + compilation.errors.push( + CssMinimizerPlugin.buildError( + error, + assetName, + task.inputSourceMap && + CssMinimizerPlugin.isSourceMap(task.inputSourceMap) + ? new SourceMapConsumer(task.inputSourceMap) + : null, + new RequestShortener(compiler.context) + ) + ); + + return Promise.resolve(); } - // Webpack@5 return `undefined` when cache is not found - if (!taskResult) { - return enqueue(task); + task.css = resultOutput.css; + task.map = resultOutput.map; + task.warnings = resultOutput.warnings; + + if (task.map) { + task.source = new SourceMapSource( + task.css, + assetName, + task.map, + task.input, + task.inputSourceMap, + true + ); + } else { + task.source = new RawSource(task.css); } - task.callback(taskResult); + await cache.store(task); + } else { + task.source = resultOutput.source; + task.warnings = resultOutput.warnings; + } - return Promise.resolve(); + if (task.warnings && task.warnings.length > 0) { + task.warnings.forEach((warning) => { + const builtWarning = CssMinimizerPlugin.buildWarning( + warning, + assetName, + task.inputSourceMap && + CssMinimizerPlugin.isSourceMap(task.inputSourceMap) + ? new SourceMapConsumer(task.inputSourceMap) + : null, + new RequestShortener(compiler.context), + this.options.warningsFilter + ); + + if (builtWarning) { + compilation.warnings.push(builtWarning); + } + }); } - return enqueue(task); + const { source, assetInfo } = task; + + CssMinimizerPlugin.updateAsset(compilation, assetName, source, { + ...assetInfo, + minimized: true, + }); + + return Promise.resolve(); }) ); } @@ -445,7 +406,12 @@ class CssMinimizerPlugin { } } + static isWebpack4() { + return webpackVersion[0] === '4'; + } + apply(compiler) { + const pluginName = this.constructor.name; const { devtool, plugins } = compiler.options; this.options.sourceMap = @@ -471,35 +437,28 @@ class CssMinimizerPlugin { this.options ); - const optimizeFn = async (compilation, chunksOrAssets) => { + const weakCache = new WeakMap(); + + const optimizeFn = async (compilation, CacheEngine, assets) => { const assetNames = Object.keys( - CssMinimizerPlugin.isWebpack4() ? compilation.assets : chunksOrAssets - ).filter((file) => matchObject(file)); + typeof assets === 'undefined' ? compilation.assets : assets + ).filter((assetName) => matchObject(assetName)); if (assetNames.length === 0) { return Promise.resolve(); } - const getTaskForAsset = this.taskGenerator.bind( - this, + await this.runTasks( compiler, - compilation + compilation, + assetNames, + CacheEngine, + weakCache ); - const CacheEngine = CssMinimizerPlugin.isWebpack4() - ? // eslint-disable-next-line global-require - require('./Webpack4Cache').default - : // eslint-disable-next-line global-require - require('./Webpack5Cache').default; - const cache = new CacheEngine(compilation, { cache: this.options.cache }); - - await this.runTasks(assetNames, getTaskForAsset, cache); - return Promise.resolve(); }; - const pluginName = this.constructor.name; - compiler.hooks.compilation.tap(pluginName, (compilation) => { if (this.options.sourceMap) { compilation.hooks.buildModule.tap(pluginName, (moduleArg) => { @@ -510,11 +469,25 @@ class CssMinimizerPlugin { } if (CssMinimizerPlugin.isWebpack4()) { - compilation.hooks.optimizeChunkAssets.tapPromise( - pluginName, - optimizeFn.bind(this, compilation) + // eslint-disable-next-line global-require + const CacheEngine = require('./Webpack4Cache').default; + + compilation.hooks.optimizeChunkAssets.tapPromise(pluginName, () => + // eslint-disable-next-line no-undefined + optimizeFn(compilation, CacheEngine, undefined, weakCache) ); } else { + if (this.options.sourceMap) { + compilation.hooks.buildModule.tap(pluginName, (moduleArg) => { + // to get detailed location info about errors + // eslint-disable-next-line no-param-reassign + moduleArg.useSourceMap = true; + }); + } + + // eslint-disable-next-line global-require + const CacheEngine = require('./Webpack5Cache').default; + // eslint-disable-next-line global-require const Compilation = require('webpack/lib/Compilation'); @@ -523,7 +496,7 @@ class CssMinimizerPlugin { name: pluginName, stage: Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE, }, - optimizeFn.bind(this, compilation) + (assets) => optimizeFn(compilation, CacheEngine, assets) ); compilation.hooks.statsPrinter.tap(pluginName, (stats) => { diff --git a/src/minify.js b/src/minify.js index 99620f2..7fa8165 100644 --- a/src/minify.js +++ b/src/minify.js @@ -10,7 +10,7 @@ function warningsToString(warnings) { const minify = async (options) => { const { - name, + assetName, input, minimizerOptions, map, @@ -18,7 +18,7 @@ const minify = async (options) => { minify: minifyFn, } = options; - const postcssOptions = { to: name, from: name }; + const postcssOptions = { to: assetName, from: assetName }; if (minifyFn) { const result = await minifyFn( @@ -29,7 +29,6 @@ const minify = async (options) => { return { css: result.css, map: result.map, - error: result.error, warnings: warningsToString(result.warnings || []), }; } @@ -43,7 +42,6 @@ const minify = async (options) => { return { css: result.css, map: result.map, - error: result.error, warnings: warningsToString(result.warnings()), }; }; diff --git a/test/CssMinimizerPlugin.test.js b/test/CssMinimizerPlugin.test.js index 1f35340..f023b5a 100644 --- a/test/CssMinimizerPlugin.test.js +++ b/test/CssMinimizerPlugin.test.js @@ -1,4 +1,5 @@ import path from 'path'; +import crypto from 'crypto'; import { SourceMapConsumer } from 'source-map'; import MiniCssExtractPlugin from 'mini-css-extract-plugin'; @@ -255,6 +256,38 @@ describe('CssMinimizerPlugin', () => { }); }); + it('should throw error from postcss', () => { + const compiler = getCompiler({ + entry: { + foo: `${__dirname}/fixtures/test/foo.css`, + }, + }); + + new CssMinimizerPlugin({ + minify: (data) => { + // eslint-disable-next-line global-require + const postcss = require('postcss'); + + const plugin = postcss.plugin('error-plugin', () => (css) => { + css.walkDecls((decl) => { + throw decl.error('Postcss error'); + }); + }); + + return postcss([plugin]) + .process(data.input, data.postcssOptions) + .then((result) => { + return result; + }); + }, + }).apply(compiler); + + return compile(compiler).then((stats) => { + expect(getErrors(stats)).toMatchSnapshot('error'); + expect(getWarnings(stats)).toMatchSnapshot('warning'); + }); + }); + it('should build warning', () => { const compiler = getCompiler({ entry: { @@ -352,7 +385,10 @@ describe('CssMinimizerPlugin', () => { test: /entry.js$/i, use: [ { - loader: path.resolve(__dirname, './helpers/preLoader'), + loader: path.resolve( + __dirname, + './helpers/emitAssetInChildCompilationLoader' + ), }, ], }, @@ -390,4 +426,186 @@ describe('CssMinimizerPlugin', () => { expect(getErrors(stats)).toMatchSnapshot('errors'); expect(getWarnings(stats)).toMatchSnapshot('warnings'); }); + + it('should work and generate real content hash', async () => { + if (getCompiler.isWebpack4()) { + expect(true).toBe(true); + } else { + const compiler = getCompiler({ + entry: { + entry: `${__dirname}/fixtures/entry.js`, + }, + output: { + pathinfo: false, + path: path.resolve(__dirname, 'dist'), + filename: '[name].[contenthash].[chunkhash].[fullhash].js', + chunkFilename: '[name].[contenthash].[chunkhash].[fullhash].js', + }, + optimization: { + minimize: false, + realContentHash: true, + }, + plugins: [ + new MiniCssExtractPlugin({ + filename: '[name].[contenthash].[chunkhash].[fullhash].css', + chunkFilename: '[name].[contenthash].[chunkhash].[fullhash].css', + }), + ], + }); + + new CssMinimizerPlugin().apply(compiler); + + const stats = await compile(compiler); + const { + compilation: { + assets, + options: { output }, + }, + } = stats; + + for (const assetName of Object.keys(assets)) { + const [, webpackHash] = assetName.match(/^.+?\.(.+?)\..+$/); + const { hashDigestLength, hashDigest, hashFunction } = output; + const cryptoHash = crypto + .createHash(hashFunction) + .update(readAsset(assetName, compiler, stats)) + .digest(hashDigest) + .slice(0, hashDigestLength); + + expect(webpackHash).toBe(cryptoHash); + } + + expect(readAssets(compiler, stats, '.css')).toMatchSnapshot('assets'); + expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + } + }); + + it('should work in watch mode', async () => { + const compiler = getCompiler({ + entry: { + foo: `${__dirname}/fixtures/simple.js`, + }, + plugins: [], + module: { + rules: [ + { + test: /.s?css$/i, + use: ['css-loader'], + }, + { + test: /simple-emit.js$/i, + loader: require.resolve('./helpers/emitAssetLoader.js'), + }, + { + test: /simple-emit-2.js$/i, + loader: require.resolve('./helpers/emitAssetLoader2.js'), + }, + ], + }, + }); + + new CssMinimizerPlugin().apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(4); + } else { + expect(stats.compilation.emittedAssets.size).toBe(4); + } + + expect(readAssets(compiler, stats, '.css')).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(0); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(0); + } + + expect(readAssets(compiler, newStats, '.css')).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); + + it('should work in watch mode when "cache" is "false"', async () => { + const compiler = getCompiler({ + entry: { + foo: `${__dirname}/fixtures/simple.js`, + }, + plugins: [], + module: { + rules: [ + { + test: /.s?css$/i, + use: ['css-loader'], + }, + { + test: /simple-emit.js$/i, + loader: require.resolve('./helpers/emitAssetLoader.js'), + }, + { + test: /simple-emit-2.js$/i, + loader: require.resolve('./helpers/emitAssetLoader2.js'), + }, + ], + }, + }); + + new CssMinimizerPlugin({ + cache: false, + }).apply(compiler); + + const stats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(stats.compilation.assets).filter( + (assetName) => stats.compilation.assets[assetName].emitted + ).length + ).toBe(4); + } else { + expect(stats.compilation.emittedAssets.size).toBe(4); + } + + expect(readAssets(compiler, stats, '.css')).toMatchSnapshot('assets'); + expect(getWarnings(stats)).toMatchSnapshot('errors'); + expect(getErrors(stats)).toMatchSnapshot('warnings'); + + await new Promise(async (resolve) => { + const newStats = await compile(compiler); + + if (getCompiler.isWebpack4()) { + expect( + Object.keys(newStats.compilation.assets).filter( + (assetName) => newStats.compilation.assets[assetName].emitted + ).length + ).toBe(0); + } else { + expect(newStats.compilation.emittedAssets.size).toBe(0); + } + + expect(readAssets(compiler, newStats, '.css')).toMatchSnapshot('assets'); + expect(getWarnings(newStats)).toMatchSnapshot('errors'); + expect(getErrors(newStats)).toMatchSnapshot('warnings'); + + resolve(); + }); + }); }); diff --git a/test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack4 b/test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack4 index b782d2c..68bab94 100644 --- a/test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack4 +++ b/test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack4 @@ -59,6 +59,15 @@ exports[`CssMinimizerPlugin should respect the hash options #1: errors 1`] = `Ar exports[`CssMinimizerPlugin should respect the hash options #1: warnings 1`] = `Array []`; +exports[`CssMinimizerPlugin should throw error from postcss: error 1`] = ` +Array [ + "Error: foo.css from Css Minimizer +error-plugin: /foo.css:2:3: Postcss error [foo.css:2,3]", +] +`; + +exports[`CssMinimizerPlugin should throw error from postcss: warning 1`] = `Array []`; + exports[`CssMinimizerPlugin should work and show minimized assets in stats: assets 1`] = ` Object { "foo.css": "body{color:red}a{color:#00f}", @@ -69,6 +78,50 @@ exports[`CssMinimizerPlugin should work and show minimized assets in stats: erro exports[`CssMinimizerPlugin should work and show minimized assets in stats: warnings 1`] = `Array []`; +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": assets 1`] = ` +Object { + "style-2.css": "a{color:coral}", + "style.css": "a{color:red}", +} +`; + +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": assets 2`] = ` +Object { + "style-2.css": "a{color:coral}", + "style.css": "a{color:red}", +} +`; + +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": errors 1`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": errors 2`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": warnings 1`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": warnings 2`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode: assets 1`] = ` +Object { + "style-2.css": "a{color:coral}", + "style.css": "a{color:red}", +} +`; + +exports[`CssMinimizerPlugin should work in watch mode: assets 2`] = ` +Object { + "style-2.css": "a{color:coral}", + "style.css": "a{color:red}", +} +`; + +exports[`CssMinimizerPlugin should work in watch mode: errors 1`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode: errors 2`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode: warnings 1`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode: warnings 2`] = `Array []`; + exports[`CssMinimizerPlugin should work with assets using querystring: entry.css.map?v=test 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,SACF,CACA,EACE,UACF\\",\\"file\\":\\"entry.css?v=test\\",\\"sourcesContent\\":[\\"body {\\\\n color: red;\\\\n}\\\\na {\\\\n color: blue;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; exports[`CssMinimizerPlugin should work with assets using querystring: entry.css?v=test 1`] = ` diff --git a/test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack5 b/test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack5 index b782d2c..7145de1 100644 --- a/test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack5 +++ b/test/__snapshots__/CssMinimizerPlugin.test.js.snap.webpack5 @@ -59,6 +59,25 @@ exports[`CssMinimizerPlugin should respect the hash options #1: errors 1`] = `Ar exports[`CssMinimizerPlugin should respect the hash options #1: warnings 1`] = `Array []`; +exports[`CssMinimizerPlugin should throw error from postcss: error 1`] = ` +Array [ + "Error: foo.css from Css Minimizer +error-plugin: /foo.css:2:3: Postcss error [foo.css:2,3]", +] +`; + +exports[`CssMinimizerPlugin should throw error from postcss: warning 1`] = `Array []`; + +exports[`CssMinimizerPlugin should work and generate real content hash: assets 1`] = ` +Object { + "entry.19e4764f9c1d9fe130e2.2d6ce991710d63180e35.87eaf84ce322e15b3c17.css": "body{color:red}a{color:#00f}", +} +`; + +exports[`CssMinimizerPlugin should work and generate real content hash: errors 1`] = `Array []`; + +exports[`CssMinimizerPlugin should work and generate real content hash: warnings 1`] = `Array []`; + exports[`CssMinimizerPlugin should work and show minimized assets in stats: assets 1`] = ` Object { "foo.css": "body{color:red}a{color:#00f}", @@ -69,6 +88,50 @@ exports[`CssMinimizerPlugin should work and show minimized assets in stats: erro exports[`CssMinimizerPlugin should work and show minimized assets in stats: warnings 1`] = `Array []`; +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": assets 1`] = ` +Object { + "style-2.css": "a{color:coral}", + "style.css": "a{color:red}", +} +`; + +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": assets 2`] = ` +Object { + "style-2.css": "a{color:coral}", + "style.css": "a{color:red}", +} +`; + +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": errors 1`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": errors 2`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": warnings 1`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode when "cache" is "false": warnings 2`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode: assets 1`] = ` +Object { + "style-2.css": "a{color:coral}", + "style.css": "a{color:red}", +} +`; + +exports[`CssMinimizerPlugin should work in watch mode: assets 2`] = ` +Object { + "style-2.css": "a{color:coral}", + "style.css": "a{color:red}", +} +`; + +exports[`CssMinimizerPlugin should work in watch mode: errors 1`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode: errors 2`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode: warnings 1`] = `Array []`; + +exports[`CssMinimizerPlugin should work in watch mode: warnings 2`] = `Array []`; + exports[`CssMinimizerPlugin should work with assets using querystring: entry.css.map?v=test 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,SACF,CACA,EACE,UACF\\",\\"file\\":\\"entry.css?v=test\\",\\"sourcesContent\\":[\\"body {\\\\n color: red;\\\\n}\\\\na {\\\\n color: blue;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; exports[`CssMinimizerPlugin should work with assets using querystring: entry.css?v=test 1`] = ` diff --git a/test/__snapshots__/cache-option.test.js.snap.webpack4 b/test/__snapshots__/cache-option.test.js.snap.webpack4 index ce5ae8c..b77e3d8 100644 --- a/test/__snapshots__/cache-option.test.js.snap.webpack4 +++ b/test/__snapshots__/cache-option.test.js.snap.webpack4 @@ -153,3 +153,51 @@ exports[`cache option should match snapshot when a value is not specify: errors exports[`cache option should match snapshot when a value is not specify: warnings 1`] = `Array []`; exports[`cache option should match snapshot when a value is not specify: warnings 2`] = `Array []`; + +exports[`cache option should match snapshot when sourcemap enable: assets 1`] = ` +Object { + "five.css": "body{color:red;font-size:20px}a{color:#00f} +/*# sourceMappingURL=five.css.map*/", + "four.css": "h1{color:green}h2{color:#ff0} +/*# sourceMappingURL=four.css.map*/", + "one.css": "a{text-align:center} +/*# sourceMappingURL=one.css.map*/", + "three.css": "body{color:red;font-size:20px}a{color:#00f} +/*# sourceMappingURL=three.css.map*/", + "two.css": "a{text-align:center} +/*# sourceMappingURL=two.css.map*/", +} +`; + +exports[`cache option should match snapshot when sourcemap enable: assets 2`] = ` +Object { + "five.css": "body{color:red;font-size:20px}a{color:#00f} +/*# sourceMappingURL=five.css.map*/", + "four.css": "h1{color:green}h2{color:#ff0} +/*# sourceMappingURL=four.css.map*/", + "one.css": "a{text-align:center} +/*# sourceMappingURL=one.css.map*/", + "three.css": "body{color:red;font-size:20px}a{color:#00f} +/*# sourceMappingURL=three.css.map*/", + "two.css": "a{text-align:center} +/*# sourceMappingURL=two.css.map*/", +} +`; + +exports[`cache option should match snapshot when sourcemap enable: errors 1`] = `Array []`; + +exports[`cache option should match snapshot when sourcemap enable: errors 2`] = `Array []`; + +exports[`cache option should match snapshot when sourcemap enable: five.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAGA,KACE,SAAU,CACV,cAAe,CAEjB,EACE,UAAW\\",\\"file\\":\\"five.css\\",\\"sourcesContent\\":[\\"body {\\\\n color: red;\\\\n}\\\\nbody {\\\\n color: red;\\\\n font-size: 20px;\\\\n}\\\\na {\\\\n color: blue;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}"`; + +exports[`cache option should match snapshot when sourcemap enable: four.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,GACE,WAAY,CAEd,GACE,UAAa\\",\\"file\\":\\"four.css\\",\\"sourcesContent\\":[\\"h1 {\\\\n color: green;\\\\n}\\\\nh2 {\\\\n color: yellow;\\\\n}\\\\nh3 {\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}"`; + +exports[`cache option should match snapshot when sourcemap enable: one.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,EACE,iBAAkB\\",\\"file\\":\\"one.css\\",\\"sourcesContent\\":[\\"a {\\\\n text-align: center;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}"`; + +exports[`cache option should match snapshot when sourcemap enable: three.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAGA,KACE,SAAU,CACV,cAAe,CAEjB,EACE,UAAW\\",\\"file\\":\\"three.css\\",\\"sourcesContent\\":[\\"body {\\\\n color: red;\\\\n}\\\\nbody {\\\\n color: red;\\\\n font-size: 20px;\\\\n}\\\\na {\\\\n color: blue;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}"`; + +exports[`cache option should match snapshot when sourcemap enable: two.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,EACE,iBAAkB\\",\\"file\\":\\"two.css\\",\\"sourcesContent\\":[\\"a {\\\\n text-align: center;\\\\n}\\\\n\\"],\\"sourceRoot\\":\\"\\"}"`; + +exports[`cache option should match snapshot when sourcemap enable: warnings 1`] = `Array []`; + +exports[`cache option should match snapshot when sourcemap enable: warnings 2`] = `Array []`; diff --git a/test/__snapshots__/sourceMap-option.test.js.snap.webpack4 b/test/__snapshots__/sourceMap-option.test.js.snap.webpack4 index 197ec7f..7a59b64 100644 --- a/test/__snapshots__/sourceMap-option.test.js.snap.webpack4 +++ b/test/__snapshots__/sourceMap-option.test.js.snap.webpack4 @@ -31,9 +31,9 @@ Object { } `; -exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; -exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: errors 1`] = `Array []`; @@ -48,9 +48,9 @@ Object { } `; -exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; -exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: errors 1`] = `Array []`; @@ -67,9 +67,9 @@ Object { exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): errors 1`] = `Array []`; -exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"dist/entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"dist/entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; -exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"dist/entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"dist/entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): warnings 1`] = `Array []`; @@ -77,7 +77,7 @@ exports[`when applied with "sourceMap" option should emit warning when broken so Array [ "Error: broken-source-map.css from Css Minimizer Error: \\"version\\" is a required argument.", - "ModuleBuildError: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): + "ModuleBuildError: Module build failed (from /node_modules/mini-css-extract-plugin/dist/loader.js): Error: broken-source-map.css from Css Minimizer", ] `; diff --git a/test/__snapshots__/sourceMap-option.test.js.snap.webpack5 b/test/__snapshots__/sourceMap-option.test.js.snap.webpack5 index 197ec7f..7f419dd 100644 --- a/test/__snapshots__/sourceMap-option.test.js.snap.webpack5 +++ b/test/__snapshots__/sourceMap-option.test.js.snap.webpack5 @@ -31,9 +31,9 @@ Object { } `; -exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; -exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; exports[`when applied with "sourceMap" option matches snapshot for "true" value, using previous sourcemap: errors 1`] = `Array []`; @@ -48,9 +48,9 @@ Object { } `; -exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; -exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; exports[`when applied with "sourceMap" option matches snapshot for "true" value, without previous sourcemap: errors 1`] = `Array []`; @@ -67,9 +67,9 @@ Object { exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): errors 1`] = `Array []`; -exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"dist/entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCCnB,OAGI,iBAAkB\\",\\"file\\":\\"dist/entry.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n a {\\\\n text-align: center;\\\\n }\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; -exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,gBCEA,SDFiB,CCGlB,OAGC,iBAAkB\\",\\"file\\":\\"dist/entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; +exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): sourcemaps/entry2.css.map 1`] = `"{\\"version\\":3,\\"sources\\": [replaced for tests], \\"names\\":[],\\"mappings\\":\\"AAAA,KACE,eAAiB,CCEjB,SDFiB,CCKnB,OACE,iBAAkB\\",\\"file\\":\\"dist/entry2.css\\",\\"sourcesContent\\":[\\"body {\\\\n font-weight: bold;\\\\n}\\",\\"@import 'bar';\\\\n\\\\nbody {\\\\n color: red;\\\\n}\\\\n\\\\nbody a {\\\\n text-align: center;\\\\n}\\"],\\"sourceRoot\\":\\"\\"}"`; exports[`when applied with "sourceMap" option matches snapshot when using SourceMapDevToolPlugin (with filename, publicPath and fileContext options): warnings 1`] = `Array []`; @@ -77,7 +77,7 @@ exports[`when applied with "sourceMap" option should emit warning when broken so Array [ "Error: broken-source-map.css from Css Minimizer Error: \\"version\\" is a required argument.", - "ModuleBuildError: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): + "ModuleBuildError: Module build failed (from ../../node_modules/mini-css-extract-plugin/dist/loader.js): Error: broken-source-map.css from Css Minimizer", ] `; diff --git a/test/__snapshots__/worker.test.js.snap.webpack4 b/test/__snapshots__/worker.test.js.snap.webpack4 index 4d31720..24006ff 100644 --- a/test/__snapshots__/worker.test.js.snap.webpack4 +++ b/test/__snapshots__/worker.test.js.snap.webpack4 @@ -6,12 +6,6 @@ Array [ ] `; -exports[`worker should emit minimizer error: error 1`] = ` -Array [ - "css minimizer error", -] -`; - exports[`worker should minify css: css 1`] = `".foo{color:red}.bar{color:coral}"`; exports[`worker should minify css: map 1`] = ` diff --git a/test/__snapshots__/worker.test.js.snap.webpack5 b/test/__snapshots__/worker.test.js.snap.webpack5 index 4d31720..24006ff 100644 --- a/test/__snapshots__/worker.test.js.snap.webpack5 +++ b/test/__snapshots__/worker.test.js.snap.webpack5 @@ -6,12 +6,6 @@ Array [ ] `; -exports[`worker should emit minimizer error: error 1`] = ` -Array [ - "css minimizer error", -] -`; - exports[`worker should minify css: css 1`] = `".foo{color:red}.bar{color:coral}"`; exports[`worker should minify css: map 1`] = ` diff --git a/test/cache-option.test.js b/test/cache-option.test.js index 98e0728..3c22bde 100644 --- a/test/cache-option.test.js +++ b/test/cache-option.test.js @@ -4,6 +4,8 @@ import del from 'del'; import cacache from 'cacache'; import findCacheDir from 'find-cache-dir'; +import MiniCssExtractPlugin from 'mini-css-extract-plugin'; + import Webpack4Cache from '../src/Webpack4Cache'; import CssMinimizerPlugin from '../src/index'; @@ -12,6 +14,7 @@ import { getCompiler, getErrors, getWarnings, + normalizedSourceMap, readAssets, removeCache, } from './helpers'; @@ -31,6 +34,7 @@ const otherOtherOtherCacheDir = findCacheDir({ if (getCompiler.isWebpack4()) { describe('cache option', () => { let compiler; + let sourceMapCompiler; beforeEach(() => { compiler = getCompiler({ @@ -43,6 +47,31 @@ if (getCompiler.isWebpack4()) { }, }); + sourceMapCompiler = getCompiler({ + devtool: 'source-map', + entry: { + one: `${__dirname}/fixtures/cache.js`, + two: `${__dirname}/fixtures/cache-1.js`, + three: `${__dirname}/fixtures/cache-2.js`, + four: `${__dirname}/fixtures/cache-3.js`, + five: `${__dirname}/fixtures/cache-4.js`, + }, + module: { + rules: [ + { + test: /.s?css$/i, + use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'], + }, + ], + }, + plugins: [ + new MiniCssExtractPlugin({ + filename: '[name].css', + chunkFilename: '[id].[name].css', + }), + ], + }); + return Promise.all([ removeCache(), removeCache(uniqueCacheDirectory), @@ -324,6 +353,63 @@ if (getCompiler.isWebpack4()) { cacachePutSpy.mockRestore(); getCacheDirectorySpy.mockRestore(); }); + + it('should match snapshot when sourcemap enable', async () => { + const cacacheGetSpy = jest.spyOn(cacache, 'get'); + const cacachePutSpy = jest.spyOn(cacache, 'put'); + + const getCacheDirectorySpy = jest + .spyOn(Webpack4Cache, 'getCacheDirectory') + .mockImplementation(() => uniqueCacheDirectory); + + new CssMinimizerPlugin({ sourceMap: true }).apply(sourceMapCompiler); + + const stats = await compile(sourceMapCompiler); + + expect(readAssets(sourceMapCompiler, stats, '.css')).toMatchSnapshot( + 'assets' + ); + expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + + const countAssets = Object.keys( + readAssets(sourceMapCompiler, stats, '.css') + ).length; + + // Try to found cached files, but we don't have their in cache + expect(cacacheGetSpy).toHaveBeenCalledTimes(countAssets); + // Put files in cache + expect(cacachePutSpy).toHaveBeenCalledTimes(countAssets); + + cacache.get.mockClear(); + cacache.put.mockClear(); + + const newStats = await compile(sourceMapCompiler); + + expect(readAssets(sourceMapCompiler, newStats, '.css')).toMatchSnapshot( + 'assets' + ); + expect(getErrors(stats)).toMatchSnapshot('errors'); + expect(getWarnings(stats)).toMatchSnapshot('warnings'); + + const newCountAssets = Object.keys( + readAssets(sourceMapCompiler, newStats, '.css') + ).length; + + const maps = readAssets(sourceMapCompiler, newStats, '.css.map'); + + Object.keys(maps).forEach((assetKey) => { + expect(normalizedSourceMap(maps[assetKey])).toMatchSnapshot(assetKey); + }); + + // Now we have cached files so we get them and don't put new + expect(cacacheGetSpy).toHaveBeenCalledTimes(newCountAssets); + expect(cacachePutSpy).toHaveBeenCalledTimes(0); + + cacacheGetSpy.mockRestore(); + cacachePutSpy.mockRestore(); + getCacheDirectorySpy.mockRestore(); + }); }); } else { describe('"cache" option', () => { diff --git a/test/fixtures/simple-async.js b/test/fixtures/simple-async.js new file mode 100644 index 0000000..d9a5cff --- /dev/null +++ b/test/fixtures/simple-async.js @@ -0,0 +1 @@ +export default 'bar'; diff --git a/test/fixtures/simple-emit-2.js b/test/fixtures/simple-emit-2.js new file mode 100644 index 0000000..d9a5cff --- /dev/null +++ b/test/fixtures/simple-emit-2.js @@ -0,0 +1 @@ +export default 'bar'; diff --git a/test/fixtures/simple-emit.js b/test/fixtures/simple-emit.js new file mode 100644 index 0000000..d02ba54 --- /dev/null +++ b/test/fixtures/simple-emit.js @@ -0,0 +1 @@ +export default 'foo'; diff --git a/test/fixtures/simple.js b/test/fixtures/simple.js new file mode 100644 index 0000000..5b298a6 --- /dev/null +++ b/test/fixtures/simple.js @@ -0,0 +1,10 @@ +import foo from './simple-emit'; +import bar from './simple-emit-2'; + +async function load() { + return import('./simple-async'); +} + +load(); + +export default [foo, bar, css, otherCss]; diff --git a/test/helpers/preLoader.js b/test/helpers/emitAssetInChildCompilationLoader.js similarity index 100% rename from test/helpers/preLoader.js rename to test/helpers/emitAssetInChildCompilationLoader.js diff --git a/test/helpers/emitAssetLoader.js b/test/helpers/emitAssetLoader.js new file mode 100644 index 0000000..4ba8281 --- /dev/null +++ b/test/helpers/emitAssetLoader.js @@ -0,0 +1,7 @@ +export default function loader(content) { + this.emitFile('style.css', 'a { color: red; }'); + + const callback = this.async(); + + return callback(null, content); +} diff --git a/test/helpers/emitAssetLoader2.js b/test/helpers/emitAssetLoader2.js new file mode 100644 index 0000000..a99bb4b --- /dev/null +++ b/test/helpers/emitAssetLoader2.js @@ -0,0 +1,7 @@ +export default function loader(content) { + this.emitFile('style-2.css', 'a { color: coral; }'); + + const callback = this.async(); + + return callback(null, content); +} diff --git a/test/helpers/getCompiler.js b/test/helpers/getCompiler.js index 3b439dd..681a7b9 100644 --- a/test/helpers/getCompiler.js +++ b/test/helpers/getCompiler.js @@ -4,17 +4,16 @@ import webpack from 'webpack'; import MiniCssExtractPlugin from 'mini-css-extract-plugin'; import { createFsFromVolume, Volume } from 'memfs'; -export default function getCompiler(options) { +export default function getCompiler(config) { const compiler = webpack({ - mode: 'production', - bail: true, - cache: getCompiler.isWebpack4() ? false : { type: 'memory' }, + mode: 'development', + devtool: config.devtool || false, + context: path.resolve(__dirname, '../fixtures'), optimization: { minimize: false, }, output: { - pathinfo: false, - path: path.resolve(__dirname, 'dist'), + path: path.resolve(__dirname, '../outputs'), filename: '[name].js', chunkFilename: '[id].[name].js', }, @@ -32,14 +31,16 @@ export default function getCompiler(options) { }, ], }, - ...options, + ...config, }); - const outputFileSystem = createFsFromVolume(new Volume()); - // Todo remove when we drop webpack@4 support - outputFileSystem.join = path.join.bind(path); + if (!config.outputFileSystem) { + const outputFileSystem = createFsFromVolume(new Volume()); + // Todo remove when we drop webpack@4 support + outputFileSystem.join = path.join.bind(path); - compiler.outputFileSystem = outputFileSystem; + compiler.outputFileSystem = outputFileSystem; + } return compiler; } diff --git a/test/worker.test.js b/test/worker.test.js index 9466921..b42833c 100644 --- a/test/worker.test.js +++ b/test/worker.test.js @@ -7,7 +7,7 @@ import { normalizeErrors } from './helpers'; describe('worker', () => { it('should minify css', async () => { const options = { - name: 'entry.css', + assetName: 'entry.css', input: '.foo{color:red;}\n.bar{color:coral;}', inputSourceMap: { version: 3, @@ -27,7 +27,7 @@ describe('worker', () => { it('should work inputSourceMap as prev', async () => { const options = { - name: 'entry.css', + assetName: 'entry.css', input: '.foo{color:red;}\n.bar{color:coral;}', minimizerOptions: { discardComments: false }, inputSourceMap: { @@ -47,7 +47,7 @@ describe('worker', () => { it('should work options.minify function', async () => { const options = { - name: 'entry.css', + assetName: 'entry.css', input: '.foo{color:red;}\n.bar{color:coral;}', minimizerOptions: { discardComments: false }, minify: () => { @@ -62,7 +62,7 @@ describe('worker', () => { it('should emit error', async () => { const options = { - name: 'entry.css', + assetName: 'entry.css', input: false, }; @@ -76,24 +76,4 @@ describe('worker', () => { expect(normalizeErrors(normalizeError.message)).toMatchSnapshot('error'); } }); - - it('should emit minimizer error', async () => { - const options = { - name: 'entry.css', - input: false, - minify: () => { - return { error: new Error('css minimizer error') }; - }, - }; - - try { - await transform(serialize(options)); - } catch (error) { - const normalizeError = { ...error }; - - normalizeError.message = [error.message.split('\n')]; - - expect(normalizeErrors(normalizeError.message)).toMatchSnapshot('error'); - } - }); });