BETA

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">
<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>

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