forked from kuizuo/js-deobfuscator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
54 lines (53 loc) · 1.45 KB
/
vite.config.ts
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
import path from 'path'
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import inject from '@rollup/plugin-inject'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import Pages from 'vite-plugin-pages'
import WindiCSS from 'vite-plugin-windicss'
import PurgeIcons from 'vite-plugin-purge-icons'
// https://vitejs.dev/config/
export default defineConfig({
define: {
'process.env': {},
'process.platform': null,
'process.version': null,
// Buffer: ['buffer', 'Buffer'], // 编译需要将这行注释,才能编译通过
},
resolve: {
alias: {
'~/': `${path.resolve(__dirname, 'src')}/`,
'/@/': `${path.resolve(__dirname, 'src')}/`,
},
},
plugins: [
Vue({
// reactivityTransform: true,
}),
// https://github.com/hannoeru/vite-plugin-pages
Pages({
importMode: 'sync',
}),
Components({
resolvers: [ElementPlusResolver()],
dts: 'src/components.d.ts',
}),
AutoImport({
resolvers: [ElementPlusResolver()],
imports: ['vue', 'vue/macros', 'vue-router', '@vueuse/core'],
dts: 'src/auto-import.d.ts',
}),
WindiCSS(),
PurgeIcons({}),
],
build: {
rollupOptions: {
plugins: [inject({ Buffer: ['buffer', 'Buffer'] })],
},
commonjsOptions: {
transformMixedEsModules: true,
},
},
})