-
-
Notifications
You must be signed in to change notification settings - Fork 136
/
vite.config.js
54 lines (51 loc) · 1.49 KB
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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();