This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
51 lines (50 loc) · 1.48 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
import path from 'path';
import ViteRestart from 'vite-plugin-restart';
import manifestSRI from 'vite-plugin-manifest-sri';
import viteCompression from 'vite-plugin-compression';
// https://vitejs.dev/config/
/**
* @type {import('vite').UserConfig}
*/
export default ({ command }) => {
return {
base: command === 'serve' ? '' : '/assets/dist/',
build: {
commonjsOptions: {
transformMixedEsModules: true,
},
manifest: 'manifest.json',
outDir: path.resolve(__dirname, 'web/assets/dist/'),
assetsDir: './',
rollupOptions: {
input: {
app: path.resolve(__dirname, 'resources/js/app.js'),
},
}
},
plugins: [
manifestSRI(),
viteCompression({
filter: /\.(js|mjs|json|css|map)$/i
}),
ViteRestart({
reload: [
path.resolve(__dirname, 'templates/**/*')
],
}),
],
publicDir: path.resolve(__dirname, 'resources/public'),
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources'),
'@css': path.resolve(__dirname, 'resources/css'),
'@js': path.resolve(__dirname, 'resources/js'),
},
},
server: {
host: '0.0.0.0',
port: 3000,
strictPort: true,
},
};
};