improvement: move window/umd bridge out of core (#1865)
This commit is contained in:
parent
855efd848e
commit
8f0d2d64a8
@ -21,7 +21,6 @@
|
||||
"dependencies": {
|
||||
"ajv": "^6.4.0",
|
||||
"ajv-errors": "^1.0.0",
|
||||
"create-react-class": "^15.6.0",
|
||||
"diacritics": "^1.3.0",
|
||||
"emotion": "^9.2.6",
|
||||
"fuzzy": "^0.1.1",
|
||||
|
@ -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 };
|
||||
|
@ -21,6 +21,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"create-react-class": "^15.6.0",
|
||||
"emotion": "^9.2.6",
|
||||
"netlify-cms-backend-bitbucket": "^2.1.0",
|
||||
"netlify-cms-backend-git-gateway": "^2.1.0",
|
||||
|
@ -1,7 +1,28 @@
|
||||
import createReactClass from 'create-react-class';
|
||||
import React from 'react';
|
||||
import CMS, { init } from 'netlify-cms-core/src';
|
||||
import './backends';
|
||||
import './widgets';
|
||||
import './editor-components';
|
||||
import './media-libraries';
|
||||
|
||||
/**
|
||||
* Load Netlify CMS automatically if `window.CMS_MANUAL_INIT` is set.
|
||||
*/
|
||||
if (!window.CMS_MANUAL_INIT) {
|
||||
init();
|
||||
} else {
|
||||
console.log('`window.CMS_MANUAL_INIT` flag set, skipping automatic initialization.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add extension hooks to global scope.
|
||||
*/
|
||||
if (typeof window !== 'undefined') {
|
||||
window.CMS = CMS;
|
||||
window.initCMS = init;
|
||||
window.createClass = window.createClass || createReactClass;
|
||||
window.h = window.h || React.createElement;
|
||||
}
|
||||
|
||||
export { CMS as default, init };
|
||||
|
Loading…
x
Reference in New Issue
Block a user