2023-12-22 15:36:49 +00:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import preact from '@preact/preset-vite'
|
|
|
|
import { resolve } from 'path'
|
|
|
|
import alias from '@rollup/plugin-alias'
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
|
|
plugins: [preact()],
|
|
|
|
root: 'web',
|
|
|
|
base: '',
|
|
|
|
optimizeDeps: {
|
|
|
|
exclude: ['@vector-im/compound-web'],
|
|
|
|
},
|
|
|
|
build: {
|
|
|
|
outDir: '../public',
|
|
|
|
rollupOptions: {
|
|
|
|
input: {
|
|
|
|
main: resolve('web', 'index.html'),
|
|
|
|
oauth: resolve('web', 'oauth.html'),
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
alias({
|
|
|
|
entries: [
|
|
|
|
{ find: 'react', replacement: 'preact/compat' },
|
|
|
|
{ find: 'react-dom/test-utils', replacement: 'preact/test-utils' },
|
|
|
|
{ find: 'react-dom', replacement: 'preact/compat' },
|
|
|
|
{ find: 'react/jsx-runtime', replacement: 'preact/jsx-runtime' }
|
|
|
|
]
|
|
|
|
})
|
|
|
|
]
|
|
|
|
},
|
|
|
|
emptyOutDir: true,
|
|
|
|
},
|
2024-11-28 15:04:01 +00:00
|
|
|
css: {
|
|
|
|
preprocessorOptions: {
|
|
|
|
scss: {
|
|
|
|
api: 'modern'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-12-22 15:36:49 +00:00
|
|
|
})
|