I am looking for a way for aliases using React Native, and not something like:
require('../../blah')
I could do:
require('src/blah')
where 'src' is at the root of the directory.
You can always use your application name as root. (the name that is written in yours package.json):
package.json
require('<package name>/img/yourimage.png')
+1 I also need this feature.
I am currently using a browser to associate js files with the response-native label as external and use the aliasify module for path aliases. As a second step, I pass my package to package.
, , - node_modules (, ).
...
You can use the pragma fbjs @providesModule. Basically adding the source file:
/** * @providesModule blah */
It allows you require('blah')to other files.
require('blah')
AFAIK, this feature should only be used for Facebook so that it can trigger warnings or interrupt in the future.
Source: https://habr.com/ru/post/1608022/More articles:Getting highway name - Skobbler - iosCheck if there is a list of "partial" lines in the list of complete lines - pythonHow to write a HQL Insert query? - javahow colored data points are based on some rules in matplotlib - pythonAndroid emulator closes with telnet via appium script - javaОшибка добавления правила предупреждения в Azure Cloud Service - powershellHow to run babel.transform to react with Nashorn? - javascriptSpring Deployment / Hosting Boot Application - javaIs it legal (accidentally) to specify a class name twice when calling a static function? - c ++Spring XML-enabled REST Download - springAll Articles