handle platform-specific image files when running use-figwheel

Platform-specific file names for images as described in the React-Native docs at http://facebook.github.io/react-native/releases/0.37/docs/images.html
This commit is contained in:
Paul Currit 2016-11-22 20:46:45 -08:00
parent 58a4d67e48
commit 5b5c3436a7

View File

@ -216,6 +216,7 @@ scanImageDir = (dir) ->
.filter (path) -> fs.statSync(path).isFile() .filter (path) -> fs.statSync(path).isFile()
.filter (path) -> removeExcludeFiles(path) .filter (path) -> removeExcludeFiles(path)
.map (path) -> path.replace /@2x|@3x/i, '' .map (path) -> path.replace /@2x|@3x/i, ''
.map (path) -> path.replace new RegExp(".(android|ios)" + fpath.extname(path) + "$", "i"), fpath.extname(path)
.filter (v, idx, slf) -> slf.indexOf(v) == idx .filter (v, idx, slf) -> slf.indexOf(v) == idx
dirs = fs.readdirSync(dir) dirs = fs.readdirSync(dir)