From 6095b33ab2ca248c3b0caa65a21b863218b7e184 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Thu, 16 Mar 2023 22:13:42 +0100 Subject: [PATCH] fix vite build --- packages/frontend/vite.config.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/frontend/vite.config.ts b/packages/frontend/vite.config.ts index a90ee55268..7e21b3d850 100644 --- a/packages/frontend/vite.config.ts +++ b/packages/frontend/vite.config.ts @@ -86,6 +86,11 @@ export default defineConfig(({ command, mode }) => { __VUE_PROD_DEVTOOLS__: false, }, + // https://vitejs.dev/guide/dep-pre-bundling.html#monorepos-and-linked-dependencies + optimizeDeps: { + include: ['misskey-js'], + }, + build: { target: [ 'chrome108', @@ -110,6 +115,11 @@ export default defineConfig(({ command, mode }) => { emptyOutDir: false, sourcemap: process.env.NODE_ENV === 'development', reportCompressedSize: false, + + // https://vitejs.dev/guide/dep-pre-bundling.html#monorepos-and-linked-dependencies + commonjsOptions: { + include: [/misskey-js/, /node_modules/], + }, }, test: {