-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
64 lines (63 loc) · 1.81 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
55
56
57
58
59
60
61
62
63
64
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import path from 'path'
import { viteStaticCopy } from 'vite-plugin-static-copy'
import { sentryVitePlugin } from "@sentry/vite-plugin";
import topLevelAwait from "vite-plugin-top-level-await";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svelte(), topLevelAwait(), viteStaticCopy({
targets: [
{
src: './node_modules/@leaphy-robotics/leaphy-blocks/media/*',
dest: 'blockly-assets'
},
{
src: './node_modules/@leaphy-robotics/avrdude-webassembly/avrdude.wasm',
dest: ''
},
{
src: './node_modules/@leaphy-robotics/avrdude-webassembly/avrdude-worker.js',
dest: ''
},
{
src: './node_modules/@leaphy-robotics/avrdude-webassembly/avrdude.conf',
dest: ''
},
{
src: "./node_modules/@leaphy-robotics/dfu-util-wasm/build/*",
dest: 'dfu-util'
},
{
src: "./node_modules/@leaphy-robotics/picotool-wasm/build/*",
dest: 'picotool'
},
]
}),
// Upload source maps to Sentry
sentryVitePlugin({
url: "https://leaphyeasybloqs.com:8443",
project: "leaphy-webbased-svelte",
org: 'leaphy',
authToken: process.env.SENTRY_AUTH_TOKEN,
})
],
resolve: {
alias: {
$components: path.resolve(__dirname, './src/lib/components'),
$assets: path.resolve(__dirname, './src/assets'),
$domain: path.resolve(__dirname, './src/lib/domain'),
$state: path.resolve(__dirname, './src/lib/state'),
$examples: path.resolve(__dirname, './src/lib/examples')
}
},
server: {
headers: {
"Cross-Origin-Embedder-Policy": "require-corp",
"Cross-Origin-Opener-Policy": "same-origin"
}
},
build: {
sourcemap: true
}
})