mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
allow plugins to require('react')
This commit is contained in:
parent
622a4e78e2
commit
a3d5004c13
1 changed files with 9 additions and 0 deletions
|
|
@ -6,6 +6,15 @@ import React from 'react';
|
|||
import Notification from '../components/notification';
|
||||
import notify from './notify';
|
||||
|
||||
var Module = require('module');
|
||||
var originalLoad = Module._load;
|
||||
Module._load = function (path) {
|
||||
if (path === 'react') {
|
||||
return React;
|
||||
}
|
||||
return originalLoad.apply(this, arguments);
|
||||
};
|
||||
|
||||
// remote interface to `../plugins`
|
||||
let plugins = remote.require('./plugins');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue