From 2722d865506a65d90e248b8c1538f06ee7c8e9c6 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 15 May 2019 15:13:39 +0200 Subject: [PATCH] Dashboard Build: Use StaticSiteGeneratorPlugin to build Static HTML --- _inc/client/static.jsx | 14 +++-- package.json | 1 + tools/builder/react.js | 97 +++-------------------------------- webpack.config.js | 52 +++++++++++++++---- yarn.lock | 114 +++++++++++++++++++++++++++++++++++++++-- 5 files changed, 172 insertions(+), 106 deletions(-) diff --git a/_inc/client/static.jsx b/_inc/client/static.jsx index 7740e8d08ef53..e1a571d2060bf 100644 --- a/_inc/client/static.jsx +++ b/_inc/client/static.jsx @@ -1,8 +1,8 @@ /** * External dependencies */ -import Server from 'react-dom/server'; import React from 'react'; +import { renderToStaticMarkup } from 'react-dom/server'; import { Provider } from 'react-redux'; /** @@ -12,7 +12,7 @@ import store from 'state/redux-store'; import StaticMain from 'static-main'; import StaticWarning from 'components/jetpack-notices/static-warning'; -window.staticHtml = Server.renderToStaticMarkup( +const staticHtml = renderToStaticMarkup(
@@ -20,7 +20,7 @@ window.staticHtml = Server.renderToStaticMarkup(
); -window.noscriptNotice = Server.renderToStaticMarkup( +const noscriptNotice = renderToStaticMarkup(