2022-12-21 00:17:51 +09:00
|
|
|
import { defineConfig } from 'vite';
|
|
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
import { wasm } from '@rollup/plugin-wasm';
|
|
|
|
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
2023-01-15 13:22:58 +09:00
|
|
|
import { svgLoader } from './viteSvgLoader';
|
2022-12-21 00:17:51 +09:00
|
|
|
|
|
|
|
const copyFiles = {
|
|
|
|
targets: [
|
|
|
|
{
|
|
|
|
src: 'node_modules/@matrix-org/olm/olm.wasm',
|
|
|
|
dest: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: '_redirects',
|
|
|
|
dest: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'config.json',
|
|
|
|
dest: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'public/res/android',
|
|
|
|
dest: 'public/',
|
|
|
|
}
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
appType: 'spa',
|
|
|
|
publicDir: false,
|
|
|
|
server: {
|
|
|
|
port: 8080,
|
|
|
|
host: true,
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
viteStaticCopy(copyFiles),
|
2023-01-15 13:22:58 +09:00
|
|
|
svgLoader(),
|
2022-12-21 00:17:51 +09:00
|
|
|
wasm(),
|
|
|
|
react(),
|
|
|
|
],
|
|
|
|
build: {
|
|
|
|
outDir: 'dist',
|
|
|
|
sourcemap: true,
|
|
|
|
copyPublicDir: false,
|
|
|
|
},
|
|
|
|
});
|