After authoring your Custom Application, you eventually want to deploy your application to a staging environment for testing purposes or to a production environment. One of the key steps to prepare your Custom Application for a deployment is creating a production build of your Custom Application.
This section helps prepare your Custom Application for deployment by creating a production build.
Before you get started, you need to do the following:
To run the application in
production mode, we need to build it using the following command:
mc-scripts build command creates a
<ApplicationShell> due to Code-Splitting.
The command also generates a file named
index.html.template. This file is generated by Webpack and contains references to the bundles, for example:
<!DOCTYPE html><html lang="en"><head><link href="__CDN_URL__17.app.988cd155551de3c7e71c.css" rel='stylesheet' type='text/css' /></link><!-- other elements --></head><body><div id="app"></div><!-- other elements --><script src="__CDN_URL__runtime~app.47483a5f2f8fed96e937.js"></script></body></html>
index.html.template is very important and needs to be compiled into the
index.html so that the Custom Application can be served on production.