d4d7934c89
- Configure Vite dev server with localhost binding and public asset proxy - Add npm scripts for concurrent Laravel/Vite development (dev:local, dev:test) - Implement asset import/export in ACP via ZIP file upload/download - Create AssetController for asset management endpoints - Add asset management UI tab in admin panel
83 lines
2.4 KiB
JavaScript
83 lines
2.4 KiB
JavaScript
import { defineConfig } from 'vite';
|
|
import laravel from 'laravel-vite-plugin';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
laravel({
|
|
input: ['resources/js/main.jsx'],
|
|
refresh: true,
|
|
}),
|
|
react(),
|
|
],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (!id.includes('/node_modules/')) {
|
|
return undefined;
|
|
}
|
|
|
|
if (
|
|
id.includes('/react-data-table-component/') ||
|
|
id.includes('/react-dropzone/')
|
|
) {
|
|
return 'acp-vendor';
|
|
}
|
|
|
|
if (
|
|
id.includes('/react-router/') ||
|
|
id.includes('/react-router-dom/') ||
|
|
id.includes('/@remix-run/')
|
|
) {
|
|
return 'router-vendor';
|
|
}
|
|
|
|
if (
|
|
id.includes('/react/') ||
|
|
id.includes('/react-dom/') ||
|
|
id.includes('/scheduler/')
|
|
) {
|
|
return 'react-vendor';
|
|
}
|
|
|
|
if (
|
|
id.includes('/react-bootstrap/') ||
|
|
id.includes('/bootstrap/') ||
|
|
id.includes('/bootstrap-icons/')
|
|
) {
|
|
return 'ui-vendor';
|
|
}
|
|
|
|
if (
|
|
id.includes('/i18next/') ||
|
|
id.includes('/react-i18next/') ||
|
|
id.includes('/i18next-http-backend/')
|
|
) {
|
|
return 'i18n-vendor';
|
|
}
|
|
|
|
return 'vendor';
|
|
},
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
host: '127.0.0.1',
|
|
port: 5173,
|
|
proxy: {
|
|
'/images': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
'/storage': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
watch: {
|
|
ignored: ['**/storage/framework/views/**'],
|
|
},
|
|
},
|
|
});
|