From c85c623d2550cb2e5f2c08125ffc5a1695d0cb17 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 18 Sep 2023 16:57:13 -0500 Subject: [PATCH] vite: simplify config --- vite.config.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index c10c4ff74e..6cf320e2ad 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,10 +11,7 @@ import vitePluginRequire from 'vite-plugin-require'; import { viteStaticCopy } from 'vite-plugin-static-copy'; export default defineConfig({ - root: 'src', build: { - // Relative to the root - outDir: '../dist', assetsDir: 'packs', assetsInlineLimit: 0, rollupOptions: { @@ -25,6 +22,7 @@ export default defineConfig({ }, }, }, + assetsInclude: ['**/*.oga'], server: { port: 3036, }, @@ -33,7 +31,7 @@ export default defineConfig({ vitePluginRequire.default(), compileTime(), createHtmlPlugin({ - template: 'index.html', + template: 'src/index.html', minify: { collapseWhitespace: true, removeComments: false, @@ -62,12 +60,12 @@ export default defineConfig({ short_name: 'Soapbox', description: 'A social media frontend with a focus on custom branding and ease of use.', }, - srcDir: 'service-worker', + srcDir: 'src/service-worker', filename: 'sw.ts', }), viteStaticCopy({ targets: [{ - src: '../node_modules/twemoji/assets/svg/*', + src: './node_modules/twemoji/assets/svg/*', dest: 'packs/emoji/', }], }), @@ -82,13 +80,9 @@ export default defineConfig({ { find: 'soapbox', replacement: fileURLToPath(new URL('./src', import.meta.url)) }, ], }, - assetsInclude: ['**/*.oga'], test: { globals: true, environment: 'jsdom', - cache: { - dir: '../node_modules/.vitest', - }, - setupFiles: 'jest/test-setup.ts', + setupFiles: 'src/jest/test-setup.ts', }, }); \ No newline at end of file