<?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>How to get a production build with Liferay for react? Liferay 7.2</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119712436" />
  <subtitle>How to get a production build with Liferay for react? Liferay 7.2</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119712436</id>
  <updated>2026-04-05T17:09:35Z</updated>
  <dc:date>2026-04-05T17:09:35Z</dc:date>
  <entry>
    <title>RE: How to get a production build with Liferay for react? Liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119716264" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119716264</id>
    <updated>2020-08-06T07:07:20Z</updated>
    <published>2020-08-06T07:07:20Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I am not really a react guy, but check the package.json file.&lt;br&gt;You usually need to have an extra build target for that, and usually implement it by adding some parameters to the npm scripts, eg. in our case with webpack it looks this way: (npm run production)&lt;br&gt;&lt;pre&gt;&lt;code&gt;"production": "cross-env NODE_ENV=production ./node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config webpack/config/webpack.prod.js",&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;I hope, there is already a fitting target in in the package.json. If not, you could try to set the environment variable as we do it. But the build has to support that. The script has to check the mode and use e.g. TerserPlugin or something like that in that case.&lt;br&gt;&lt;pre&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2020-08-06T07:07:20Z</dc:date>
  </entry>
  <entry>
    <title>How to get a production build with Liferay for react? Liferay 7.2</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119712435" />
    <author>
      <name>Marco Portillo</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119712435</id>
    <updated>2020-08-05T14:53:46Z</updated>
    <published>2020-08-05T14:53:46Z</published>
    <summary type="html">Hi,I have been searching on the internet for a few hours, but i cannot find anything about it. I just have &lt;a href="https://help.liferay.com/hc/en-us/articles/360029028051-Developing-a-React-Application"&gt;this&lt;/a&gt;, which for development is fine, but I need to deploy my portlets as a production build as well, I always use:&lt;blockquote&gt;npm run build OR npm run deploy&lt;/blockquote&gt;but that just keeps building a normal .jar file in dev mode, and I need one for production. If I check my portlets with react developer tools in Chrome, I have this message:&lt;a href="https://user-images.githubusercontent.com/21960445/87949733-b0ee2380-caa6-11ea-9fbb-ea6f03762794.png"&gt;&lt;img src="https://user-images.githubusercontent.com/21960445/87949733-b0ee2380-caa6-11ea-9fbb-ea6f03762794.png"  alt="image" /&gt;&lt;br /&gt;&lt;a href="https://user-images.githubusercontent.com/21960445/87949733-b0ee2380-caa6-11ea-9fbb-ea6f03762794.png"&gt;&lt;/a&gt;What to do? Any ideas?</summary>
    <dc:creator>Marco Portillo</dc:creator>
    <dc:date>2020-08-05T14:53:46Z</dc:date>
  </entry>
</feed>
