How to use the netlify-cms-app/dist/esm.NetlifyCmsApp.init function in netlify-cms-app

To help you get started, we’ve selected a few netlify-cms-app examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github netlify / netlify-cms / packages / netlify-cms / src / index.js View on Github external
import createReactClass from 'create-react-class';
import React from 'react';
import { NetlifyCmsApp as CMS } from 'netlify-cms-app/dist/esm';
import './extensions';

/**
 * Load Netlify CMS automatically if `window.CMS_MANUAL_INIT` is set.
 */
if (!window.CMS_MANUAL_INIT) {
  CMS.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 = CMS.init;
  window.createClass = window.createClass || createReactClass;
  window.h = window.h || React.createElement;
  /**
   * Log the version number.
   */
  if (typeof NETLIFY_CMS_VERSION === 'string') {