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: {