-
Notifications
You must be signed in to change notification settings - Fork 62
/
vite.config.js
47 lines (46 loc) · 1.51 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
import {defineConfig} from 'vite';
import laravel from 'laravel-vite-plugin';
import react from '@vitejs/plugin-react';
import path from "path";
import purge from '@erbelion/vite-plugin-laravel-purgecss';
export default defineConfig({
plugins: [
laravel({
input: ['resources/js/app.tsx', 'vendor/juzaweb/modules/resources/css/app.scss'],
refresh: true,
}),
// purge({
// paths: [
// 'vendor/juzaweb/modules/resources/views/**/*.blade.php',
// 'vendor/juzaweb/modules/resources/js/**/*.tsx',
// ],
// safelist: {
// standard: [/fa-(.*)$/],
// }
// }),
react(),
],
build: {
outDir: path.resolve(__dirname, 'public/jw-styles/juzaweb/build'),
},
resolve: {
preserveSymlinks: true,
alias: {
'@': path.resolve(__dirname + '/vendor/juzaweb/modules/resources/js'),
},
},
experimental: {
renderBuiltUrl(filename, {hostId, hostType, type}) {
// if (type === 'public') {
// return 'https://www.domain.com/' + filename
// }
// else if (path.extname(hostId) === '.js') {
// return { runtime: `window.__assetsPath(${JSON.stringify(filename)})` }
// }
// else {
// return 'https://cdn.domain.com/assets/' + filename
// }
return `/jw-styles/juzaweb/build/${filename}`
}
}
});