Use require so we can import conditionally
This commit is contained in:
parent
527c390152
commit
ed9c29d365
2 changed files with 7 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue