-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.playground.ts
More file actions
49 lines (41 loc) · 1.21 KB
/
vite.config.playground.ts
File metadata and controls
49 lines (41 loc) · 1.21 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
import { resolve } from 'node:path'
import swcPlugin from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import glsl from 'vite-plugin-glsl'
import { lightscriptDecoratorsPlugin } from './packages/dev/plugins'
/**
* Vite config for building the playground as a static SPA
* This builds the dev UI for deployment to GitHub Pages
*/
export default defineConfig({
base: '/lightscript-workshop/playground/',
build: {
emptyOutDir: true,
outDir: 'dist-playground',
rollupOptions: {
input: resolve(__dirname, 'index.html'),
},
},
define: {
__DEV__: false,
__EFFECT_ID__: JSON.stringify('default'),
},
plugins: [
// React SWC with Preact compatibility
swcPlugin({
tsDecorators: true,
}),
// GLSL shader support
glsl(),
// Decorator metadata for controls
lightscriptDecoratorsPlugin(),
],
resolve: {
alias: {
'@lightscript/core': resolve(__dirname, 'packages/core/src'),
'@lightscript/dev': resolve(__dirname, 'packages/dev/src'),
react: 'preact/compat',
'react-dom': 'preact/compat',
},
},
})