laravel_core #12

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