I’m doing some dev with Vue3& Vite using VisualCode on MacOS.
However, I can not make the watcher work without usePolling: true.
Meaning that without usePolling: true, my watcher does not work at wall. I’m sure it’s a config issue, but really don’t know which one. Either Vcode or Vite.config
This uses a lot of CPU because it’s a big project. I read about WSL, but doesn’t apply being already on mac.
My vite.config is this:
export default defineConfig(({mode}) => {
// const mode = mode?.NODE_ENV || 'development';
// console.log("Current mode:", mode);
// const env = dotenv.config({ path: `./.env.${mode}` }).parsed;
return {
plugins: [vue()],
debug: true,
define: {
},
resolve: {
alias: {
'@src': path.resolve(__dirname, 'src'), // Adjust the path accordingly
},
},
build: {
target: 'es2015',
outDir: 'dist',
envFile: true
},
server: {
hmr: { overlay: true }, // Disable HMR overlay
watch: {
ignored: ['!**/dist/'],
usePolling: false
}
},
}
});
I’m new to this modern front-end development, coming from a backend experience, so I don’t know where to pick this up.