From 6b9a0a17763ec920dbcace9d681a9f0f7506de50 Mon Sep 17 00:00:00 2001 From: vasya Date: Sat, 11 Apr 2026 21:52:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=20=D1=81?= =?UTF-8?q?=D0=B1=D0=BE=D1=80=D1=89=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.js | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/vite.config.js b/vite.config.js index f35b4e7..7d8506c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,18 +1,29 @@ import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; -import tailwindcss from '@tailwindcss/vite'; +import react from '@vitejs/plugin-react'; // Подключите плагин React +import { globbySync } from 'globby'; //Пакет для универсального указания файлов разлиных модулей + +// Ищем все JS/CS точки входа во всех модулях +const moduleEntries = globbySync([ + 'Modules/*/resources/js/app.{jsx,tsx}', // Все app.jsx и app.tsx в подпапках Modules + 'Modules/*/resources/css/app.css', // Все app.css +]); export default defineConfig({ - plugins: [ - laravel({ - input: ['resources/css/app.css', 'resources/js/app.js'], - refresh: true, - }), - tailwindcss(), - ], - server: { - watch: { - ignored: ['**/storage/framework/views/**'], - }, - }, + plugins: [ + laravel({ + // Укажите входные точки + input: [ + 'resources/css/app.css', + 'resources/js/app.tsx', + //Благодаря переменной ниже, мы можем не указывать каждый входной jsx и css скрипты для каждого модуля + ...moduleEntries, + ], + refresh: true, + }), + react(), // Подключаем плагин React + ], + esbuild: { + loader: 'tsx', // Важно для обработки TypeScript + }, });