Building for Production
Deploying applications to production starts with creating an artifact that can be deployed. In the case of Vue.js, we're building a client-side application, which means our build artifact will contain HTML, JavaScript, and CSS files.
The Vue CLI comes with a build
command. This build
command will take our Vue.js single-file components (.vue
files) and compile them into render functions (JavaScript functions that the Vue runtime can use to render our application) that will be output to JavaScript.
As part of the build process, the Vue CLI will take JavaScript, Vue single-file components, and modules that are imported into each other and bundle them. Bundling means that related chunks of code that depend on each other will be output as a single JavaScript file.
Due to our use of the Vue CLI, the Vue.js library itself can also be slimmed down. The Vue.js runtime bundle can include a runtime compiler that takes string templates and turns them into...