Skip to content

Instantly share code, notes, and snippets.

@xdumaine
Created November 19, 2019 16:47
Show Gist options
  • Save xdumaine/ccb07a1284b1743be717f272d0ea66a4 to your computer and use it in GitHub Desktop.
Save xdumaine/ccb07a1284b1743be717f272d0ea66a4 to your computer and use it in GitHub Desktop.
svg export for various react-native icon sizes
const svgExport = require("svgexport");
const output = process.argv[2];
const input = process.argv[3];
const images = [
[".android.png", "36:"],
["@1.5x.android.png", "54:"],
["@2x.android.png", "72:"],
["@2x.ios.png", "72:"],
["@3x.android.png", "108:"],
["@3x.ios.png", "108:"],
["@4x.android.png", "144:"]
];
images.forEach(([name, size]) => {
svgExport.render([
{
input: "icon.svg",
output: images.map(i => [`${output}${i[0]}`, i[1]])
}
]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment