' + renderToStaticMarkup(...args);
+}
+
+module.exports = {
+ renderToStaticMarkupWithDoctype,
+};
diff --git a/lib/server/server.js b/lib/server/server.js
index 39894e06c492..121af213ff37 100644
--- a/lib/server/server.js
+++ b/lib/server/server.js
@@ -1,5 +1,4 @@
/**
-
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
@@ -7,27 +6,26 @@
*/
function execute(port) {
- const extractTranslations = require('../write-translations.js');
+ const extractTranslations = require('../write-translations');
const env = require('./env.js');
- const translation = require('./translation.js');
+ const translation = require('./translation');
const express = require('express');
const React = require('react');
const request = require('request');
- const renderToStaticMarkup = require('react-dom/server').renderToStaticMarkup;
const fs = require('fs-extra');
const os = require('os');
const path = require('path');
const color = require('color');
- const toSlug = require('../core/toSlug.js');
+ const toSlug = require('../core/toSlug');
const mkdirp = require('mkdirp');
const glob = require('glob');
const chalk = require('chalk');
- const translate = require('./translate.js');
+ const translate = require('./translate');
+ const {renderToStaticMarkupWithDoctype} = require('./renderUtils');
- const feed = require('./feed.js');
- const sitemap = require('./sitemap.js');
- // const sitemap = require("sitemap");
+ const feed = require('./feed');
+ const sitemap = require('./sitemap');
const CWD = process.cwd();
@@ -250,7 +248,7 @@ function execute(port) {
);
- res.send(renderToStaticMarkup(docComp));
+ res.send(renderToStaticMarkupWithDoctype(docComp));
});
app.get('/sitemap.xml', function(req, res) {
@@ -293,7 +291,7 @@ function execute(port) {
config={siteConfig}
/>
);
- const str = renderToStaticMarkup(blogPageComp);
+ const str = renderToStaticMarkupWithDoctype(blogPageComp);
let path = (page > 0 ? 'page' + (page + 1) : '') + '/index.html';
blogPages[path] = str;
@@ -344,7 +342,7 @@ function execute(port) {
{rawContent}
);
- res.send(renderToStaticMarkup(blogPostComp));
+ res.send(renderToStaticMarkupWithDoctype(blogPostComp));
}
});
@@ -365,7 +363,7 @@ function execute(port) {
if (siteConfig.wrapPagesHTML) {
removeModuleAndChildrenFromCache(join('..', 'core', 'Site.js'));
const Site = require(join('..', 'core', 'Site.js'));
- const str = renderToStaticMarkup(
+ const str = renderToStaticMarkupWithDoctype(