Vite configuration options
The vite.config.js
file exports the configuration that Vite will use for development and also for production. Vite was meant to be functional for many different frameworks and not only for Vue 3, even though it is the official bundler for it. When we open the file, we notice that Vue is a plugin for Vite. Internally, Vite uses Rollup.js (https://www.rollupjs.org/) and esbuild (https://esbuild.github.io/), for development and production build, respectively. This means that we can pass options to Vite, but also have even more fine-grained control over some edge cases by passing arguments to these two underlining tools. Additionally, you can pass different configurations for each processing mode (development and production), so we are not left without options here.
We will see some specific configurations for deployment in Chapter 10, Deploying Your Application, but for now, we will focus only on the development part with a few additions to keep us from typing...