-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathvite.config.js
52 lines (51 loc) · 1.37 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
52
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import { resolve } from "path";
export default defineConfig(mode => {
const { VITE_APP_BASE_URL } = loadEnv(mode.mode, process.cwd());
return {
plugins: [vue(), vueJsx()],
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler" // or 'modern'
}
}
},
resolve: {
alias: {
"@": resolve(__dirname, "src"),
vue: "vue/dist/vue.esm-bundler.js"
}
},
assetsInclude: ["**/*.hdr", "**/*.glb"],
esbuild: { loader: { ".js": ".jsx" } },
base: VITE_APP_BASE_URL,
server: {
host: "0.0.0.0",
open: true,
port: 9999
},
build: {
outDir: "threejs-3dmodel-edit",
assetsDir: "static",
emptyOutDir: true,
minify: "esbuild",
rollupOptions: {
input: {
index: resolve(__dirname, "index.html"),
preview: resolve(__dirname, "preview.html"),
modelIframe: resolve(__dirname, "modelIframe.html"),
vrPage: resolve(__dirname, "vrPage.html")
},
output: {
compact: true,
entryFileNames: "static/js/[name]-[hash].js",
chunkFileNames: "static/js/[name]-[hash].js",
assetFileNames: "static/[ext]/[name].[ext]"
}
}
}
};
});