forked from YOOTeam/OpenPPT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
52 lines (51 loc) · 1.17 KB
/
vite.config.ts
File metadata and controls
52 lines (51 loc) · 1.17 KB
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 { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { createHtmlPlugin } from 'vite-plugin-html'
const moment = require('moment')
export default defineConfig(({ command, mode }) => {
return {
base: '',
plugins: [
vue(),
createHtmlPlugin({
/**
* 需要注入 index.html ejs 模版的数据
*/
inject: {
data: {
timestamp: new Date().getTime(),
},
},
}),
],
css: {
preprocessorOptions: {
scss: {
additionalData: `
@import '@/assets/styles/variable.scss';
@import '@/assets/styles/mixin.scss';
`,
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src/'), // 确保路径正确指向你的源代码目录
},
},
server: {
host: '0.0.0.0',
},
build: {
rollupOptions: {
external: /^src\/.*/,
output: {
entryFileNames: `assets/[name].[hash].js`,
assetFileNames: `assets/[name].[hash].[ext]`,
},
},
},
}
})