-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.js
78 lines (72 loc) · 1.52 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import path from "path";
import copy from 'rollup-plugin-copy'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { visualizer } from 'rollup-plugin-visualizer'
import del from 'rollup-plugin-delete'
import mv from "rollup-plugin-mv";
// https://vitejs.dev/config/
const APPNAME = "scriptor"
export default defineConfig(({command, mode})=>{
let conf = {
css: {
preprocessorOptions:{
less: {
additionalData:`@import "./src/style/app.less";`
}
}
},
plugins: [
visualizer(
{
template:"network"
}
),
copy({
targets: [
{
src: path.join(__dirname, "index.html"),
dest: path.join(__dirname, `${APPNAME}`)
}
],
hook:"buildStart"
}),
copy({
targets: [
{
src: path.join(__dirname, "node_modules", "@viur", "viur-shoelace", "dist", "assets"),
dest: path.join(__dirname, 'public', 'static', APPNAME, "viur-shoelace")
}
]
}),
vue({
template: {
compilerOptions: {
isCustomElement: tag => tag.startsWith('sl-')
}
}
})
],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src")
}
},
build: {
"outDir": `../../deploy`,
"emptyOutDir":false,
"assetsDir": `${APPNAME}`,
"assetsInlineLimit": 0,
"chunkSizeWarningLimit": 700,
rollupOptions: {
input:{
index: path.resolve(__dirname, `${APPNAME}/index.html`),
}
}
},
define: {
'__APP_VERSION__': JSON.stringify(process.env.npm_package_version),
}
}
return conf
})