laravel_core #12

Open
dupsogod wants to merge 25 commits from laravel_core into master
Showing only changes of commit 6b9a0a1776 - Show all commits
+18 -7
View File
@@ -1,18 +1,29 @@
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin'; 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({ export default defineConfig({
plugins: [ plugins: [
laravel({ laravel({
input: ['resources/css/app.css', 'resources/js/app.js'], // Укажите входные точки
input: [
'resources/css/app.css',
'resources/js/app.tsx',
//Благодаря переменной ниже, мы можем не указывать каждый входной jsx и css скрипты для каждого модуля
...moduleEntries,
],
refresh: true, refresh: true,
}), }),
tailwindcss(), react(), // Подключаем плагин React
], ],
server: { esbuild: {
watch: { loader: 'tsx', // Важно для обработки TypeScript
ignored: ['**/storage/framework/views/**'],
},
}, },
}); });