From 49b78596e93f649ead6dc808729d3785e07f7c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=B2=E9=B8=BD?= <1020103647@qq.com> Date: Tue, 26 Mar 2024 10:48:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20windows=20=E9=87=8C=E9=9D=A2=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=8A=A5=E9=94=99=EF=BC=8C?= =?UTF-8?q?BUSY=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 341fdc1..660e293 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -28,6 +28,8 @@ import ViteRestart from 'vite-plugin-restart' import { visualizer } from 'rollup-plugin-visualizer' import imagemin from './vite-plugins/imagemin' +console.log('process.platform -> ', process.platform) + // https://vitejs.dev/config/ export default ({ command, mode }) => { // console.log(mode === process.env.NODE_ENV) // true @@ -134,6 +136,13 @@ export default ({ command, mode }) => { drop_debugger: env.VITE_DELETE_CONSOLE === 'true', }, }, + // 解决windows系统对微信小程序自动关闭服务的问题 + watch: + process.platform === 'win32' // 检测是否为 windows 系统 + ? { + exclude: ['node_modules/**', '/__uno.css'], + } + : null, }, }) }