<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Liferay 7.3: MVC Portlet with React - How to run React in Production Mode?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119974914" />
  <subtitle>Liferay 7.3: MVC Portlet with React - How to run React in Production Mode?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119974914</id>
  <updated>2026-04-26T16:17:52Z</updated>
  <dc:date>2026-04-26T16:17:52Z</dc:date>
  <entry>
    <title>RE: Liferay 7.3: MVC Portlet with React - How to run React in Production Mo</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120102241" />
    <author>
      <name>Erik Strauß</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120102241</id>
    <updated>2020-10-16T09:09:29Z</updated>
    <published>2020-10-16T09:09:29Z</published>
    <summary type="html">Nobody has an idea how I can change that? &lt;br /&gt;The liferay-npm-bundler must be able to do that ...</summary>
    <dc:creator>Erik Strauß</dc:creator>
    <dc:date>2020-10-16T09:09:29Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7.3: MVC Portlet with React - How to run React in Production Mo</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119995097" />
    <author>
      <name>Erik Strauß</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119995097</id>
    <updated>2020-09-24T04:38:33Z</updated>
    <published>2020-09-24T04:38:33Z</published>
    <summary type="html">I have already tried - unfortunately without success.&lt;br /&gt;Does anyone else have an idea?</summary>
    <dc:creator>Erik Strauß</dc:creator>
    <dc:date>2020-09-24T04:38:33Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7.3: MVC Portlet with React - How to run React in Production Mo</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119979411" />
    <author>
      <name>Danilo Buzar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119979411</id>
    <updated>2020-09-21T13:34:21Z</updated>
    <published>2020-09-21T13:34:21Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Erik,You could try adding NODE_ENV=production in build script, like:&lt;br&gt;&lt;pre&gt;&lt;code&gt;"scripts": {
  "build": "NODE_ENV=production babel --source-maps -d build/resources/main/META-INF/resources src/main/resources/META-INF/resources &amp;amp;amp;&amp;amp;amp; liferay-npm-bundler"
},&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Danilo Buzar</dc:creator>
    <dc:date>2020-09-21T13:34:21Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7.3: MVC Portlet with React - How to run React in Production Mode?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119974913" />
    <author>
      <name>Erik Strauß</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119974913</id>
    <updated>2020-09-21T11:32:09Z</updated>
    <published>2020-09-21T11:32:09Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hello together,&lt;br&gt;&lt;br&gt;I have an MVC portlet with React JS in the frontend. Everything is working fine, but my jar file is always delivered with React in developer mode. How can I change this? Where do I set the ENV_VARIBALE?&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt;I have a package.json and a .bablerc file.&amp;nbsp;The whole thing is built with the liferay-npm-bundler.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;[code]{
   "dependencies": {
      "react": "^16.13.1",
      "react-dom": "^16.13.1"
   },
   "devDependencies": {
      "@babel/cli": "^7.11.6",
      "@babel/core": "^7.11.6",
      "@babel/plugin-proposal-class-properties": "^7.10.4",
      "@babel/plugin-proposal-object-rest-spread": "^7.11.0",
      "@babel/preset-env": "^7.11.5",
      "@babel/preset-react": "^7.10.4",
      "liferay-npm-bundler": "^2.19.1"
   },
   "main": "lib/MyJsFile.js",
   "name": "my-js-portlet",
   "scripts": {
      "build": "babel --source-maps -d build/resources/main/META-INF/resources src/main/resources/META-INF/resources &amp;amp;amp;&amp;amp;amp; liferay-npm-bundler"
   },
   "version": "1.0.0"
}&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Erik Strauß</dc:creator>
    <dc:date>2020-09-21T11:32:09Z</dc:date>
  </entry>
</feed>
