cinny/vite.config.js
Airyz 4aeb0b193b Moved twemoji outside /public
Now only the twemoji resources are copied to public at build time, that way we arent shipping any of the twemoji source as well
2023-01-11 13:42:04 +10:30

48 lines
835 B
JavaScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { wasm } from '@rollup/plugin-wasm';
import { viteStaticCopy } from 'vite-plugin-static-copy';
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/',
},
{
src: 'deps/twemoji/assets',
dest: 'public/twemoji'
}
],
}
export default defineConfig({
appType: 'spa',
publicDir: false,
server: {
port: 8080,
host: true,
},
plugins: [
viteStaticCopy(copyFiles),
wasm(),
react(),
],
build: {
outDir: 'dist',
sourcemap: true,
copyPublicDir: false,
},
});