mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Allow require of plugin apis (#977)
* Allow require of plugin apis * missing semicolon
This commit is contained in:
parent
6853a5c66f
commit
cd47cc7636
2 changed files with 5917 additions and 3 deletions
|
|
@ -10,10 +10,18 @@ import notify from './notify';
|
|||
const Module = require('module'); // eslint-disable-line import/newline-after-import
|
||||
const originalLoad = Module._load;
|
||||
Module._load = function (path) {
|
||||
if (path === 'react') {
|
||||
switch (path) {
|
||||
case 'react':
|
||||
return React;
|
||||
}
|
||||
case 'hyper/component':
|
||||
return Component;
|
||||
case 'hyper/notify':
|
||||
return notify;
|
||||
case 'hyper/Notification':
|
||||
return Notification;
|
||||
default:
|
||||
return originalLoad.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
// remote interface to `../plugins`
|
||||
|
|
|
|||
Loading…
Reference in a new issue