diff --git a/package-lock.json b/package-lock.json index 0835676..e49a315 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "clean-css": "^5.3.2", "common-tags": "^1.8.2", "css-url-parser": "^1.1.3", - "data-uri-to-buffer": "^5.0.1", + "data-uri-to-buffer": "^6.0.1", "debug": "^4.3.4", "find-up": "^6.3.0", "get-stdin": "^9.0.0", @@ -20,7 +20,7 @@ "got": "^13.0.0", "group-args": "^0.1.0", "indent-string": "^5.0.0", - "inline-critical": "^11.0.0", + "inline-critical": "^11.0.1", "is-glob": "^4.0.3", "joi": "^17.11.0", "lodash": "^4.17.21", @@ -34,7 +34,7 @@ "plugin-error": "^2.0.1", "postcss": "^8.4.31", "postcss-discard": "^2.0.0", - "postcss-image-inliner": "^6.1.0", + "postcss-image-inliner": "^6.2.0", "postcss-url": "^10.1.3", "replace-ext": "^2.0.0", "slash": "^5.1.0", @@ -73,6 +73,11 @@ "node": ">=0.10.0" } }, + "node_modules/@adobe/css-tools": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", + "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==" + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -2974,17 +2979,6 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, - "node_modules/atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "bin": { - "atob": "bin/atob.js" - }, - "engines": { - "node": ">= 4.5.0" - } - }, "node_modules/ava": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ava/-/ava-5.3.1.tgz", @@ -4112,16 +4106,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/css": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz", - "integrity": "sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==", - "dependencies": { - "inherits": "^2.0.4", - "source-map": "^0.6.1", - "source-map-resolve": "^0.6.0" - } - }, "node_modules/css-mediaquery": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.2.tgz", @@ -4235,9 +4219,9 @@ } }, "node_modules/data-uri-to-buffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-5.0.1.tgz", - "integrity": "sha512-a9l6T1qqDogvvnw0nKlfZzqsyikEBZBClF39V3TFoKhDtGBqHu2HkuomJc02j5zft8zrUaXEuoicLeW54RkzPg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.1.tgz", + "integrity": "sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==", "engines": { "node": ">= 14" } @@ -4321,14 +4305,6 @@ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" }, - "node_modules/decode-uri-component": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", - "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", - "engines": { - "node": ">=0.10" - } - }, "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -6980,12 +6956,12 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/inline-critical": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/inline-critical/-/inline-critical-11.0.0.tgz", - "integrity": "sha512-Dr3hytYHajC35IojWyZ1WD7RTenPFChKW0Tr5e38CtUib68eRZ2PLrMLlm2f6Ppp+N4pTXU52xw6UGFPXnz4dQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/inline-critical/-/inline-critical-11.0.1.tgz", + "integrity": "sha512-PJLt3GLQwN/D/mNtoqO7papJBoln5O3PkkHX4E6eUVeWYUxe4FaoQNhhY3au18qc+PSRMu2TneW0YqYXGTkJkA==", "dependencies": { + "@adobe/css-tools": "^4.3.1", "clean-css": "^5.3.2", - "css": "^3.0.0", "detect-indent": "^7.0.1", "fg-loadcss": "^2.1.0", "get-stdin": "^9.0.0", @@ -10376,9 +10352,9 @@ } }, "node_modules/postcss-image-inliner": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/postcss-image-inliner/-/postcss-image-inliner-6.1.0.tgz", - "integrity": "sha512-7YUKQeY2VnMZY+FXxxUPDoh8HFDV87BaDAxnQqt1xj1SnCKuH4r9nfqrqBBOaT9bw3/r9s/U/DFVR53YOxNIFQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-image-inliner/-/postcss-image-inliner-6.2.0.tgz", + "integrity": "sha512-RpWQxXnBE+TFU1WYdzIjgCYkRojSzCU7ktdA0owufCz+e5HCCbC/WpT8qAtRnd5ethVLpK8Bbdc8pAMKmuqMIQ==", "dependencies": { "asset-resolver": "^3.0.5", "debug": "^4.3.4", @@ -11362,16 +11338,6 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-resolve": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", - "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", - "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0" - } - }, "node_modules/source-map-support": { "version": "0.5.13", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", @@ -13096,6 +13062,11 @@ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true }, + "@adobe/css-tools": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.3.1.tgz", + "integrity": "sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==" + }, "@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -15301,11 +15272,6 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" - }, "ava": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ava/-/ava-5.3.1.tgz", @@ -16123,16 +16089,6 @@ } } }, - "css": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz", - "integrity": "sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==", - "requires": { - "inherits": "^2.0.4", - "source-map": "^0.6.1", - "source-map-resolve": "^0.6.0" - } - }, "css-mediaquery": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/css-mediaquery/-/css-mediaquery-0.1.2.tgz", @@ -16223,9 +16179,9 @@ } }, "data-uri-to-buffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-5.0.1.tgz", - "integrity": "sha512-a9l6T1qqDogvvnw0nKlfZzqsyikEBZBClF39V3TFoKhDtGBqHu2HkuomJc02j5zft8zrUaXEuoicLeW54RkzPg==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.1.tgz", + "integrity": "sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==" }, "data-urls": { "version": "4.0.0", @@ -16287,11 +16243,6 @@ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" }, - "decode-uri-component": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", - "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==" - }, "decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", @@ -18177,12 +18128,12 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "inline-critical": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/inline-critical/-/inline-critical-11.0.0.tgz", - "integrity": "sha512-Dr3hytYHajC35IojWyZ1WD7RTenPFChKW0Tr5e38CtUib68eRZ2PLrMLlm2f6Ppp+N4pTXU52xw6UGFPXnz4dQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/inline-critical/-/inline-critical-11.0.1.tgz", + "integrity": "sha512-PJLt3GLQwN/D/mNtoqO7papJBoln5O3PkkHX4E6eUVeWYUxe4FaoQNhhY3au18qc+PSRMu2TneW0YqYXGTkJkA==", "requires": { + "@adobe/css-tools": "^4.3.1", "clean-css": "^5.3.2", - "css": "^3.0.0", "detect-indent": "^7.0.1", "fg-loadcss": "^2.1.0", "get-stdin": "^9.0.0", @@ -20606,9 +20557,9 @@ } }, "postcss-image-inliner": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/postcss-image-inliner/-/postcss-image-inliner-6.1.0.tgz", - "integrity": "sha512-7YUKQeY2VnMZY+FXxxUPDoh8HFDV87BaDAxnQqt1xj1SnCKuH4r9nfqrqBBOaT9bw3/r9s/U/DFVR53YOxNIFQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-image-inliner/-/postcss-image-inliner-6.2.0.tgz", + "integrity": "sha512-RpWQxXnBE+TFU1WYdzIjgCYkRojSzCU7ktdA0owufCz+e5HCCbC/WpT8qAtRnd5ethVLpK8Bbdc8pAMKmuqMIQ==", "requires": { "asset-resolver": "^3.0.5", "debug": "^4.3.4", @@ -21304,15 +21255,6 @@ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" }, - "source-map-resolve": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", - "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0" - } - }, "source-map-support": { "version": "0.5.13", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", diff --git a/package.json b/package.json index cd2608a..0e64544 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "clean-css": "^5.3.2", "common-tags": "^1.8.2", "css-url-parser": "^1.1.3", - "data-uri-to-buffer": "^5.0.1", + "data-uri-to-buffer": "^6.0.1", "debug": "^4.3.4", "find-up": "^6.3.0", "get-stdin": "^9.0.0", @@ -39,7 +39,7 @@ "got": "^13.0.0", "group-args": "^0.1.0", "indent-string": "^5.0.0", - "inline-critical": "^11.0.0", + "inline-critical": "^11.0.1", "is-glob": "^4.0.3", "joi": "^17.11.0", "lodash": "^4.17.21", @@ -53,7 +53,7 @@ "plugin-error": "^2.0.1", "postcss": "^8.4.31", "postcss-discard": "^2.0.0", - "postcss-image-inliner": "^6.1.0", + "postcss-image-inliner": "^6.2.0", "postcss-url": "^10.1.3", "replace-ext": "^2.0.0", "slash": "^5.1.0", diff --git a/src/file.js b/src/file.js index 80fdcee..3872527 100644 --- a/src/file.js +++ b/src/file.js @@ -428,9 +428,10 @@ function getStylesheetObjects(file, options) { // support base64 encoded styles if (link.value.startsWith('data:')) { + const parsed = dataUriToBuffer(link.value); return { media, - value: dataUriToBuffer(link.value), + value: Buffer.from(parsed.buffer), }; }