Liferay 7.3: MVC Portlet with React - How to run React in Production Mode?Liferay 7.3: MVC Portlet with React - How to run React in Production Mode?https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1199749142024-03-29T12:17:58Z2024-03-29T12:17:58ZRE: Liferay 7.3: MVC Portlet with React - How to run React in Production MoErik Straußhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1201022412020-10-16T09:09:29Z2020-10-16T09:09:29ZNobody has an idea how I can change that? <br />The liferay-npm-bundler must be able to do that ...Erik Strauß2020-10-16T09:09:29ZRE: Liferay 7.3: MVC Portlet with React - How to run React in Production MoErik Straußhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1199950972020-09-24T04:38:33Z2020-09-24T04:38:33ZI have already tried - unfortunately without success.<br />Does anyone else have an idea?Erik Strauß2020-09-24T04:38:33ZRE: Liferay 7.3: MVC Portlet with React - How to run React in Production MoDanilo Buzarhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1199794112020-09-21T13:34:21Z2020-09-21T13:34:21Z<html><head></head><body>Hi Erik,You could try adding NODE_ENV=production in build script, like:<br><pre><code>"scripts": {
"build": "NODE_ENV=production babel --source-maps -d build/resources/main/META-INF/resources src/main/resources/META-INF/resources &amp;&amp; liferay-npm-bundler"
},</code></pre></body></html>Danilo Buzar2020-09-21T13:34:21ZLiferay 7.3: MVC Portlet with React - How to run React in Production Mode?Erik Straußhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1199749132020-09-21T11:32:09Z2020-09-21T11:32:09Z<html><head></head><body>Hello together,<br><br>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? <br><br>I have a package.json and a .bablerc file. The whole thing is built with the liferay-npm-bundler.<br><br><pre><code>[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