dat-project

Is it possible to shim Node's fs.readFileSync() in React Native?

坚强是说给别人听的谎言 提交于 2019-12-12 19:06:48
问题 I want to port a number of packages written for NodeJS to React Native. For this purpose I created a RN project using the popular Ignite boilerplate, then used the ReactNativify method and shim Node API objects mostly reusing existing browserify shims. (For details and some useful tips see Can we use nodejs code inside react native application?) Some Node objects are still replaced with empty mocks after transpilation, such as fs . Done in .babelrc as follows: ["module-resolver", { "alias": {