Created
November 19, 2019 16:47
-
-
Save xdumaine/ccb07a1284b1743be717f272d0ea66a4 to your computer and use it in GitHub Desktop.
svg export for various react-native icon sizes
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 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