forked from antvis/L7
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
67 lines (66 loc) · 2.01 KB
/
Copy pathvite.config.ts
File metadata and controls
67 lines (66 loc) · 2.01 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig } from 'vite';
import copy from 'vite-plugin-cp';
import vitePluginString from 'vite-plugin-string';
export default defineConfig({
root: './examples/',
server: {
port: 8080,
open: '/',
allowedHosts: ['alipay.net'],
},
base: './',
resolve: {
alias: {
'@antv/l7': path.resolve(__dirname, './packages/l7/src'),
'@antv/l7-maps': path.resolve(__dirname, './packages/maps/src'),
'@antv/l7-core': path.resolve(__dirname, './packages/core/src'),
'@antv/l7-component': path.resolve(__dirname, './packages/component/src'),
'@antv/l7-three': path.resolve(__dirname, './packages/three/src'),
'@antv/l7-layers': path.resolve(__dirname, './packages/layers/src'),
'@antv/l7-map': path.resolve(__dirname, './packages/map/src'),
'@antv/l7-renderer': path.resolve(__dirname, './packages/renderer/src'),
'@antv/l7-scene': path.resolve(__dirname, './packages/scene/src'),
'@antv/l7-source': path.resolve(__dirname, './packages/source/src'),
'@antv/l7-utils': path.resolve(__dirname, './packages/utils/src'),
},
},
plugins: [
react(),
vitePluginString({
compress: false,
include: ['**/*.vs', '**/*.fs', '**/*.vert', '**/*.frag', '**/*.glsl', '**/*.wgsl'],
}),
copy({
targets: [
{
src: './node_modules/@antv/g-device-api/dist/pkg/glsl_wgsl_compiler_bg.wasm',
dest: 'examples/public',
},
],
hook: 'buildStart',
}),
],
esbuild: {},
optimizeDeps: {
// 排除本地包,避免 esbuild 预构建时无法处理 GLSL 文件
exclude: [
'@antv/l7',
'@antv/l7-core',
'@antv/l7-maps',
'@antv/l7-layers',
'@antv/l7-component',
'@antv/l7-three',
'@antv/l7-map',
'@antv/l7-renderer',
'@antv/l7-scene',
'@antv/l7-source',
'@antv/l7-utils',
],
},
define: {
'process.env.VERSION': JSON.stringify('1.0.0'),
global: {},
},
});