From 439a22c3e552b0dc22349df7666cf9aa53ab2ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 17 Jul 2020 19:50:44 +0200 Subject: [PATCH] Update index.md --- content/en/news/0.74.2-relnotes/index.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/content/en/news/0.74.2-relnotes/index.md b/content/en/news/0.74.2-relnotes/index.md index 0f77133eb..e78d8564c 100644 --- a/content/en/news/0.74.2-relnotes/index.md +++ b/content/en/news/0.74.2-relnotes/index.md @@ -11,9 +11,14 @@ images: -This is a bug-fix release with one important fix. - -* Add .Defines to js.Build options [35011bcb](https://github.com/gohugoio/hugo/commit/35011bcb26b6fcfcbd77dc05aa8246ca45b2c2ba) [@bep](https://github.com/bep) [#7489](https://github.com/gohugoio/hugo/issues/7489) +Add .Defines to js.Build options [35011bcb](https://github.com/gohugoio/hugo/commit/35011bcb26b6fcfcbd77dc05aa8246ca45b2c2ba) [@bep](https://github.com/bep) [#7489](https://github.com/gohugoio/hugo/issues/7489) +This is needed to import `react` as a library, e.g.: + +``` +{{ $jsx := resources.Get "index.jsx" }} +{{ $options := dict "defines" (dict "process.env.NODE_ENV" "\"development\"") }} +{{ $js := $jsx | js.Build $options }} +```