Use require so we can import conditionally

This commit is contained in:
David Baker 2016-11-03 15:45:12 +00:00
parent 527c390152
commit ed9c29d365
2 changed files with 7 additions and 13 deletions

View file

@ -17,16 +17,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import ElectronPlatform from './ElectronPlatform';
import WebPlatform from './WebPlatform';
let Platform = null;
if (window && window.process && window.process && window.process.type === 'renderer') {
// we're running inside electron
Platform = ElectronPlatform;
Platform = require('./ElectronPlatform');;
} else {
Platform = WebPlatform;
Platform = require('./WebPlatform');;
}
export default Platform;