-
-
Notifications
You must be signed in to change notification settings - Fork 39
/
vite.config.ts
60 lines (55 loc) · 1.37 KB
/
vite.config.ts
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
import alias from '@rollup/plugin-alias'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
plugins: [
vue(),
tsconfigPaths(),
alias({
entries: [
{
find: '@',
replacement: resolve(__dirname, 'resources/js'),
},
{
find: '__types__',
replacement: resolve(__dirname, 'resources/js/@types'),
},
],
}),
],
root: resolve(__dirname, 'resources'),
define: {
'process.env': process.env, // Vite ditched process.env, so we need to pass it in
},
build: {
outDir: resolve(__dirname, 'dist'),
emptyOutDir: true,
target: 'ES2022',
minify: true,
manifest: true,
lib: {
entry: resolve(__dirname, 'resources/js/tool.ts'),
name: 'tool',
formats: ['umd'],
fileName: () => 'js/tool.js',
},
rollupOptions: {
input: resolve(__dirname, 'resources/js/tool.ts'),
external: ['vue', 'Nova', 'LaravelNova'],
output: {
globals: {
vue: 'Vue',
nova: 'Nova',
'laravel-nova': 'LaravelNova',
},
assetFileNames: 'css/tool.css',
},
},
},
optimizeDeps: {
include: ['vue', '@inertiajs/inertia', '@inertiajs/inertia-vue3', 'axios'],
},
})