How can I configure Vite app to minify code in development environment?

I am working on a Vite/Vanilla JS application, and my team lead wants me to see if it’s possible to output minified code when running the code in the development environment. Apparently this will be important down the line when setting up CI/CD pipeline.

My understanding of how Vite works is that it serves Native ESM to the browser in the development environment, and only bundles + minifies the code in production mode. Upon running both dev and prod servers and inspecting the code, this seems to be true.

I’ve spent hours trying to figure out how I can force minify the code in development. First of all, Vite ships with both Terser and esbuild for minifying. According to the docs, it defaults to esbuild, and you can set build.minify: Terser in the config file if you want to use Terser. However as far as I can tell, there is no info in the docs (for Vite or either of the plugins) about force minifying in the dev environment.

Any ideas would be greatly appreciated. See below for my config file code:

vite.config.js

const { resolve } = require("path");
const { defineConfig } = require("vite");

module.exports = defineConfig({
  build: {
    rollupOptions: {
      input: {
        main: resolve(__dirname, "index.html"),
        login: resolve(__dirname, "./pages/login/login.html"),
        home: resolve(__dirname, "./pages/home/home.html"),
      },
    },
  }
});

package.json

{
  "name": "vite-www",
  "version": "0.0.0",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "devDependencies": {
    "vite": "^2.7.2"
  }
}