From 24c7473f27fa401449a6da82b37b897b5a45894b Mon Sep 17 00:00:00 2001 From: "Hiramatsu, Yoshifumi" Date: Tue, 2 Feb 2021 23:21:05 +0900 Subject: [PATCH] Do not produce preRenderData when --no-prerender option is specified. (#1516) Co-authored-by: Leah --- .changeset/tidy-starfishes-joke.md | 5 +++++ packages/cli/lib/resources/body-end.ejs | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changeset/tidy-starfishes-joke.md diff --git a/.changeset/tidy-starfishes-joke.md b/.changeset/tidy-starfishes-joke.md new file mode 100644 index 000000000..a26b05703 --- /dev/null +++ b/.changeset/tidy-starfishes-joke.md @@ -0,0 +1,5 @@ +--- +'preact-cli': patch +--- + +Do not produce preRenderData when --no-prerender option is specified. diff --git a/packages/cli/lib/resources/body-end.ejs b/packages/cli/lib/resources/body-end.ejs index be0467270..7e588109a 100644 --- a/packages/cli/lib/resources/body-end.ejs +++ b/packages/cli/lib/resources/body-end.ejs @@ -1,7 +1,9 @@ <%= htmlWebpackPlugin.options.ssr() %> - +<% if (htmlWebpackPlugin.options.config.prerender === true) { %> + +<% } %> <% if (webpack.assets.filter(entry => entry.name.match(/bundle(\.\w{5})?.esm.js$/)).length > 0) { %> <% /* Fix for safari < 11 nomodule bug. TODO: Do the following only for safari. */ %>