Improve WSL detection for vite.config.ts (#5796)

This commit is contained in:
Oliver 2023-10-26 22:10:02 +11:00 committed by GitHub
parent 53c16510a1
commit 82b376de5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,12 @@
import react from '@vitejs/plugin-react';
import { platform } from 'node:os';
import { platform, release } from 'node:os';
import { defineConfig, splitVendorChunkPlugin } from 'vite';
const IS_IN_WSL = platform().includes('WSL');
const IS_IN_WSL = platform().includes('WSL') || release().includes('WSL');
if (IS_IN_WSL) {
console.log('WSL detected: using polling for file system events');
}
// https://vitejs.dev/config/
export default defineConfig({