mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-05-07 20:32:26 +00:00
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
import { defineConfig } from 'vite';
|
|
import laravel from 'laravel-vite-plugin';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import checker from 'vite-plugin-checker';
|
|
import {
|
|
collectModuleAssetsPaths,
|
|
collectModulePlugins,
|
|
} from './vite-module-loader.js';
|
|
|
|
async function getConfig() {
|
|
const paths = [
|
|
'resources/js/app.ts',
|
|
'resources/css/app.css',
|
|
'resources/css/filament/admin/theme.css',
|
|
];
|
|
const modulePaths = await collectModuleAssetsPaths('extensions');
|
|
const additionalPlugins = await collectModulePlugins('extensions');
|
|
|
|
return defineConfig({
|
|
build: {
|
|
sourcemap: true, // Source map generation must be turned on
|
|
},
|
|
plugins: [
|
|
laravel({
|
|
input: [...paths, ...modulePaths],
|
|
refresh: true,
|
|
}),
|
|
vue({
|
|
template: {
|
|
transformAssetUrls: {
|
|
base: null,
|
|
includeAbsolute: false,
|
|
},
|
|
},
|
|
}),
|
|
checker({
|
|
// e.g. use TypeScript check
|
|
typescript: true,
|
|
vueTsc: true,
|
|
lintCommand: 'eslint "./**/*.{ts,vue}"',
|
|
}),
|
|
...additionalPlugins,
|
|
],
|
|
server: {
|
|
host: true,
|
|
hmr: {
|
|
host: process.env.VITE_HOST_NAME,
|
|
clientPort: 80,
|
|
},
|
|
},
|
|
});
|
|
}
|
|
|
|
export default getConfig();
|