-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathvite.config.js
More file actions
63 lines (59 loc) · 1.87 KB
/
vite.config.js
File metadata and controls
63 lines (59 loc) · 1.87 KB
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
55
56
57
58
59
60
61
62
63
import inertia from '@inertiajs/vite';
import vue from '@vitejs/plugin-vue';
import fs from 'fs';
import laravel from 'laravel-vite-plugin';
import i18n from 'laravel-vue-i18n/vite';
import path from 'path';
import Icons from 'unplugin-icons/vite';
import { defineConfig } from 'vite';
import { collectModuleLangPaths } from './module-loader.js';
async function createConfig() {
const sslKeyPath = 'docker/ssl/app.key.pem';
const sslCertPath = 'docker/ssl/app.pem';
const hasSSL = fs.existsSync(sslKeyPath) && fs.existsSync(sslCertPath);
// Collect module language paths
const moduleLangPaths = await collectModuleLangPaths();
return defineConfig({
server: hasSSL
? {
https: {
key: fs.readFileSync(sslKeyPath),
cert: fs.readFileSync(sslCertPath),
},
}
: {},
plugins: [
laravel({
input: [
'resources/js/app.ts',
'resources/css/filament/admin/theme.css',
],
refresh: true,
}),
inertia(),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
Icons({
compiler: 'vue3',
autoInstall: true,
}),
i18n({
additionalLangPaths: moduleLangPaths,
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/js'),
'@modules': path.resolve(__dirname, 'modules'),
'ziggy-js': path.resolve(__dirname, 'vendor/tightenco/ziggy'),
},
},
});
}
export default createConfig();