-
Notifications
You must be signed in to change notification settings - Fork 5
/
vite.config.js
41 lines (37 loc) · 1.12 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
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [vue()],
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/entry.js"),
name: "cards",
formats: ["umd"],
fileName: () => "js/entry.js",
},
rollupOptions: {
input: resolve(__dirname, "resources/js/entry.js"),
external: ["vue", "Nova", "LaravelNova"],
output: {
globals: {
vue: "Vue",
nova: "Nova",
"laravel-nova": "LaravelNova",
},
assetFileNames: "css/card.css",
},
},
},
optimizeDeps: {
include: ["vue", "@inertiajs/inertia", "@inertiajs/inertia-vue3", "axios"],
},
});