improvement: move window/umd bridge out of core (#1865)

This commit is contained in:
Loïc Mahieu
2018-11-22 02:18:19 +01:00
committed by Shawn Erquhart
parent 855efd848e
commit 8f0d2d64a8
4 changed files with 22 additions and 22 deletions

View File

@ -1,25 +1,4 @@
import React from 'react';
import bootstrap from './bootstrap';
import registry from 'Lib/registry';
import createReactClass from 'create-react-class';
/**
* Load Netlify CMS automatically if `window.CMS_MANUAL_INIT` is set.
*/
if (!window.CMS_MANUAL_INIT) {
bootstrap();
} else {
console.log('`window.CMS_MANUAL_INIT` flag set, skipping automatic initialization.');
}
/**
* Add extension hooks to global scope.
*/
if (typeof window !== 'undefined') {
window.CMS = registry;
window.initCMS = bootstrap;
window.createClass = window.createClass || createReactClass;
window.h = window.h || React.createElement;
}
export { registry as default, bootstrap as init };