generated from uw-it-aca/django-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
35 lines (31 loc) · 1.18 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
import { fileURLToPath, URL } from "url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// https://vitejs.dev/config/
export default defineConfig({
// MARK: start vite build config
// vite creates a manifest and assets during the build process (local and prod)
// django collectstatics will put assets in '/static/app_name/assets'
// django will put the manifest in '/static/manifest.json'
// vite manifest prefaces all files with the path 'app_name/assets/xxxx'
build: {
manifest: true,
rollupOptions: {
input: [
// list all entry points
"./compass_vue/main.js",
],
},
outDir: "./compass/static/", // relative path to django's static directory
assetsDir: "compass/assets", // default ('assets')... this is the namespaced subdirectory of outDir that vite uses
emptyOutDir: false, // set to false to ensure favicon is not overwritten
},
base: "/static/", // allows for proper css url path creation during the build process
// MARK: standard vite/vue plugin and resolver config
plugins: [vue()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./compass_vue", import.meta.url)),
},
},
});