This ensures building isn't skipped when .mjs extension is used for the Vite config file.
Background 📜
Vite 5 deprecated CJS, so unless "type": "module" is specified in package.json (which requires using .cjs extension things like PostCSS config), the only way to avoid the deprecation warning is to rename the config file to vite.config.mjs.
Description 📖
This ensures building isn't skipped when
.mjs
extension is used for the Vite config file.Background 📜
Vite 5 deprecated CJS, so unless
"type": "module"
is specified inpackage.json
(which requires using.cjs
extension things like PostCSS config), the only way to avoid the deprecation warning is to rename the config file tovite.config.mjs
.https://vitejs.dev/guide/migration.html#deprecate-cjs-node-api
The Fix 🔨
I added
vite.config.mjs
to default watched paths.