code: function generateBundle(locale, messages, reactElements, options) {
    var builtContent;
    var onBuildWrite = options.onBuildWrite || defaultOnBuildWrite;
    options = options || {};
  
    init();
  
    assertLocale(locale);
    assertMessages(messages);
    assertReactElements(reactElements);
  
    // Load i18n content.
    loadCldr(locale);
    loadMessages(messages);
  
    // Set locale.
    Globalize.locale(locale);
  
    // Have react to render all passed components, therefore the formatters in
    // use will be created in Globalize.cache.
    _reactElements(reactElements).forEach(function(reactElement) {
      React.renderToString(reactElement);
     });
  
    // Compile all generated formatters.
    builtContent = GlobalizeCompiler(Globalize.cache);
  
    // Cleanup.
    Globalize.cache = {};
  
    return onBuildWrite(locale, builtContent);
  }
docs: generateBundle(locale, reactElements)