{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/8643","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/8643/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/8643/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/8643/events","html_url":"https://github.com/facebook/react-native/pull/8643","id":164401165,"number":8643,"title":"[cli] Add support for passing in additional assetExts to packager","user":{"login":"brentvatne","id":90494,"avatar_url":"https://avatars.githubusercontent.com/u/90494?v=3","gravatar_id":"","url":"https://api.github.com/users/brentvatne","html_url":"https://github.com/brentvatne","followers_url":"https://api.github.com/users/brentvatne/followers","following_url":"https://api.github.com/users/brentvatne/following{/other_user}","gists_url":"https://api.github.com/users/brentvatne/gists{/gist_id}","starred_url":"https://api.github.com/users/brentvatne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brentvatne/subscriptions","organizations_url":"https://api.github.com/users/brentvatne/orgs","repos_url":"https://api.github.com/users/brentvatne/repos","events_url":"https://api.github.com/users/brentvatne/events{/privacy}","received_events_url":"https://api.github.com/users/brentvatne/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20accepted","name":"GH Review: accepted","color":"009800"},{"url":"https://api.github.com/repos/facebook/react-native/labels/Import%20Failed","name":"Import Failed","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"matryoshcow","id":4085176,"avatar_url":"https://avatars.githubusercontent.com/u/4085176?v=3","gravatar_id":"","url":"https://api.github.com/users/matryoshcow","html_url":"https://github.com/matryoshcow","followers_url":"https://api.github.com/users/matryoshcow/followers","following_url":"https://api.github.com/users/matryoshcow/following{/other_user}","gists_url":"https://api.github.com/users/matryoshcow/gists{/gist_id}","starred_url":"https://api.github.com/users/matryoshcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matryoshcow/subscriptions","organizations_url":"https://api.github.com/users/matryoshcow/orgs","repos_url":"https://api.github.com/users/matryoshcow/repos","events_url":"https://api.github.com/users/matryoshcow/events{/privacy}","received_events_url":"https://api.github.com/users/matryoshcow/received_events","type":"User","site_admin":false},"assignees":[{"login":"matryoshcow","id":4085176,"avatar_url":"https://avatars.githubusercontent.com/u/4085176?v=3","gravatar_id":"","url":"https://api.github.com/users/matryoshcow","html_url":"https://github.com/matryoshcow","followers_url":"https://api.github.com/users/matryoshcow/followers","following_url":"https://api.github.com/users/matryoshcow/following{/other_user}","gists_url":"https://api.github.com/users/matryoshcow/gists{/gist_id}","starred_url":"https://api.github.com/users/matryoshcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matryoshcow/subscriptions","organizations_url":"https://api.github.com/users/matryoshcow/orgs","repos_url":"https://api.github.com/users/matryoshcow/repos","events_url":"https://api.github.com/users/matryoshcow/events{/privacy}","received_events_url":"https://api.github.com/users/matryoshcow/received_events","type":"User","site_admin":false}],"milestone":null,"comments":18,"created_at":"2016-07-07T20:35:10Z","updated_at":"2016-08-01T10:38:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/8643","html_url":"https://github.com/facebook/react-native/pull/8643","diff_url":"https://github.com/facebook/react-native/pull/8643.diff","patch_url":"https://github.com/facebook/react-native/pull/8643.patch"},"body":"Currently, the `assetExts` list is hardcoded in the packager, and so to add support for another extension for your own use case means that you need to submit a PR upstream to add the extension to the list, or just work off of a fork.\r\n\r\nThis PR adds support for passing in additional asset extensions to be recognized by the packager through `rn-cli.config.js` or as a param to the start command (eg: for UIExplorer you would do: `node local-cli/cli.js start --assetExts=ttf`)\r\n\r\n**Test plan**\r\n\r\nMade this change to UIExplorer:\r\n\r\n```diff\r\ndiff --git a/Examples/UIExplorer/UIExplorerApp.ios.js b/Examples/UIExplorer/UIExplorerApp.ios.js\r\nindex cb49d2d..425433d 100644\r\n--- a/Examples/UIExplorer/UIExplorerApp.ios.js\r\n+++ b/Examples/UIExplorer/UIExplorerApp.ios.js\r\n@@ -84,6 +84,9 @@ class UIExplorerApp extends React.Component {\r\n   }\r\n \r\n   componentDidMount() {\r\n+    var ttfExample = require('./example.ttf');\r\n+    console.log(`id for asset ./example.ttf: ${ttfExample}`);\r\n+\r\n     Linking.getInitialURL().then((url) => {\r\n       AsyncStorage.getItem(APP_STATE_KEY, (err, storedString) => {\r\n         const exampleAction = URIActionMap(this.props.exampleFromAppetizeParams);\r\ndiff --git a/Examples/UIExplorer/example.ttf b/Examples/UIExplorer/example.ttf\r\nnew file mode 100644\r\nindex 0000000..e69de29\r\n```\r\n\r\nAnd then ran `node local-cli/cli.js start --assetExts=ttf`, opened the app, it worked as expected. Then I ran it without `--assetExts=ttf` and the packager was unable to find the resource."},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/236547143","html_url":"https://github.com/facebook/react-native/pull/8643#issuecomment-236547143","issue_url":"https://api.github.com/repos/facebook/react-native/issues/8643","id":236547143,"user":{"login":"bestander","id":2121048,"avatar_url":"https://avatars.githubusercontent.com/u/2121048?v=3","gravatar_id":"","url":"https://api.github.com/users/bestander","html_url":"https://github.com/bestander","followers_url":"https://api.github.com/users/bestander/followers","following_url":"https://api.github.com/users/bestander/following{/other_user}","gists_url":"https://api.github.com/users/bestander/gists{/gist_id}","starred_url":"https://api.github.com/users/bestander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bestander/subscriptions","organizations_url":"https://api.github.com/users/bestander/orgs","repos_url":"https://api.github.com/users/bestander/repos","events_url":"https://api.github.com/users/bestander/events{/privacy}","received_events_url":"https://api.github.com/users/bestander/received_events","type":"User","site_admin":false},"created_at":"2016-08-01T10:38:18Z","updated_at":"2016-08-01T10:38:18Z","body":"Assigning to @matryoshcow to review"}}
{"actor":{"display_login":"bestander"}}