We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
为什么在crn-cli中有一个lazyRequire的实现呢?这个的作用是什么? global.lazyRequire = lazyRequire; function lazyRequire(requirePath) { var lazy = { __lazyRequireFlag: true, __lazy_module_id__ : requirePath, load : function() { var module = global.__r(this.__lazy_module_id__); return module; } }; return lazy; } 在crn的代码中有看到lazyRequire的实现,主要目的是先定义module,在使用的地方才load,才去真正require相关module。这个是我能理解的,可是crn-cli的作用是打包,为什么打包的时候还需要lazyRequire? 麻烦大佬指教一二。谢谢
global.lazyRequire = lazyRequire; function lazyRequire(requirePath) { var lazy = { __lazyRequireFlag: true, __lazy_module_id__ : requirePath, load : function() { var module = global.__r(this.__lazy_module_id__); return module; } }; return lazy; }
The text was updated successfully, but these errors were encountered:
打包的时候会执行patch动作,拷贝lazyRequire文件到node_moudles/react-native目录下。这样业务方在使用lazyRequire模块才能找到该文件。
Sorry, something went wrong.
No branches or pull requests
为什么在crn-cli中有一个lazyRequire的实现呢?这个的作用是什么?
global.lazyRequire = lazyRequire; function lazyRequire(requirePath) { var lazy = { __lazyRequireFlag: true, __lazy_module_id__ : requirePath, load : function() { var module = global.__r(this.__lazy_module_id__); return module; } }; return lazy; }
在crn的代码中有看到lazyRequire的实现,主要目的是先定义module,在使用的地方才load,才去真正require相关module。这个是我能理解的,可是crn-cli的作用是打包,为什么打包的时候还需要lazyRequire?
麻烦大佬指教一二。谢谢
The text was updated successfully, but these errors were encountered: