Production Build

After you've begun developing your application, it's time to think about deployment for testing and production purposes. This section introduces what you need to do to prepare your application for production deployment, and provides deployment examples.

In order to run the application in production mode, we need to build it using the following command:

mc-scripts build

Production build

The mc-scripts build command creates a /dist directory containing all the generated JavaScript and CSS bundles. Most of the files are artifacts of the <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">
<link href="" rel='stylesheet' type='text/css' /></link>
<!-- other elements -->
<div id="app"></div>
<!-- other elements -->
<script src="__CDN_URL__runtime~app.47483a5f2f8fed96e937.js"></script>

Eventually, this file is compiled into index.html and can be served statically by the runtime application or environment.