mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 13:17:08 +00:00
35 lines
901 B
JavaScript
35 lines
901 B
JavaScript
![]() |
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,
|
||
|
},
|
||
|
})
|