ptmt / react-native-macos

[deprecated in favor of https://microsoft.github.io/react-native-windows/] React Native for macOS is an experimental fork for writing desktop apps using Cocoa
MIT License
11.24k stars 429 forks source link

Add module resolve `react-native` to `react-native-macos` #125

Closed jhen0409 closed 7 years ago

jhen0409 commented 7 years ago

Add module resolve react-native to react-native-macos by babel-plugin-module-resolver. As a result, we can ensure that don't require('react-native') in the packager of react-native-macos.

It work with following code:

import React from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
} from 'react-native';
import FoldView from 'react-native-foldview';
ptmt commented 7 years ago

Sorry for a slow reply, need some time to consider all pros and cons on this and test it out more. I understand the problem, and have it also, so it looks legimate and good solution.

ptmt commented 7 years ago

Published as 0.12.0-alpha