Last active
March 1, 2019 19:56
-
-
Save cmccormack/8965cf8af0b44057fcbf458923306528 to your computer and use it in GitHub Desktop.
image-webpack-loader external binaries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"imagemin": "^5.3.1", | |
"imagemin-gifsicle": "^6.0.0", | |
"imagemin-mozjpeg": "^8.0.0", | |
"imagemin-optipng": "^6.0.0", | |
"imagemin-pngquant": "^6.0.0", | |
"imagemin-svgo": "^7.0.0", | |
"imagemin-webp": "^5.0.0", | |
"loader-utils": "^1.1.0", | |
"object-assign": "^4.1.1", | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://raw.githubusercontent.com/imagemin/gifsicle-bin/ | |
https://raw.githubusercontent.com/imagemin/mozjpeg-bin/ | |
https://raw.githubusercontent.com/imagemin/optipng-bin/ | |
https://raw.githubusercontent.com/imagemin/pngquant-bin/ | |
https://raw.githubusercontent.com/imagemin/cwebp-bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v0.1.0/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v0.1.1/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v0.1.2/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v0.1.3/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v0.1.4/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v0.1.5/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v0.1.6/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v0.1.7/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v1.0.0/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v1.0.1/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v1.0.2/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v1.0.3/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v2.0.0/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v2.0.1/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v3.0.0/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v3.0.1/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v3.0.2/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v3.0.3/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v3.0.4/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v4.0.0/vendor/ | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/v4.0.1/vendor/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const OUTFILE = "./mozjpeg-bin.txt"; | |
// Pasted from `time` property in npm repo | |
const versions = ` | |
0.1.0: "2014-04-23T11:17:29.755Z", | |
0.1.1: "2014-04-23T11:19:10.446Z", | |
0.1.2: "2014-04-25T12:30:38.050Z", | |
1.0.0: "2014-08-18T00:47:27.450Z", | |
2.0.0: "2014-09-10T21:33:08.232Z", | |
3.0.0: "2014-10-20T16:11:08.084Z", | |
3.1.0: "2014-10-21T14:31:36.365Z", | |
4.0.0: "2014-10-24T22:38:21.505Z", | |
5.0.0: "2015-04-20T05:56:46.145Z", | |
5.1.0: "2015-04-22T15:00:52.963Z", | |
6.0.0: "2016-04-29T13:31:48.665Z", | |
7.0.0: "2017-12-27T18:42:03.669Z", | |
8.0.0: "2018-10-30T12:52:50.440Z" | |
` | |
.trim() | |
.replace(/"(.*?)",?/g, "$1") | |
.split("\n") | |
.map(versionstr => { | |
const [version, date] = versionstr.split(": "); | |
return { version, date: new Date(date) }; | |
}); | |
const urls = ` | |
https://raw.githubusercontent.com/imagemin/gifsicle-bin/ | |
https://raw.githubusercontent.com/imagemin/mozjpeg-bin/ | |
https://raw.githubusercontent.com/imagemin/optipng-bin/ | |
https://raw.githubusercontent.com/imagemin/pngquant-bin/ | |
https://raw.githubusercontent.com/imagemin/cwebp-bin/ | |
` | |
.trim() | |
.split("\n"); | |
const files = urls.reduce( | |
(a, url) => [ | |
...a, | |
...versions.map(({ version }) => `${url}${version}/vendor/`), | |
], | |
[] | |
); | |
fs.writeFileSync(OUTFILE, files.join("\n")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment