diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index 084aa09c..7e770753 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -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", diff --git a/packages/netlify-cms-core/src/index.js b/packages/netlify-cms-core/src/index.js index b3b8bde9..b74d5d4f 100644 --- a/packages/netlify-cms-core/src/index.js +++ b/packages/netlify-cms-core/src/index.js @@ -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 }; diff --git a/packages/netlify-cms/package.json b/packages/netlify-cms/package.json index cea6957f..dc1ce8e4 100644 --- a/packages/netlify-cms/package.json +++ b/packages/netlify-cms/package.json @@ -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", diff --git a/packages/netlify-cms/src/index.js b/packages/netlify-cms/src/index.js index c8fd5234..6149c990 100644 --- a/packages/netlify-cms/src/index.js +++ b/packages/netlify-cms/src/index.js @@ -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 };