Taking your Application into Production
pom.xml
The profile is recommended so that you don’t get any unexpected problems due to production settings when running in development mode.
After this all that is needed is to run mvn clean package -Pproduction
. This will then do transpilation, minimisation and bundling on the application resources and build a production ready war.
To locally run the application in production mode with jetty you should add to the production profile:
XML
With this the server can be started with .
XML
What is transpilation and bundling
Transpilation in Flow means converting all ES6 JavaScript to ES5 JavaScript format for older browsers which for us is IE 11 and Safari 9.
Minimisation is done to make the file smaller. When minifying the code of also often obscured making it harder to read.
Bundling can also be made to create multiple bundle fragments. For information on this see