From ea27d83ea933dc7fb3318fff49c0b932fd8492c0 Mon Sep 17 00:00:00 2001 From: 134 Date: Mon, 13 Jul 2026 17:08:30 +0800 Subject: [PATCH] fix: dedupe React Three Fiber in Webpack build --- services/pascal-editor/apps/editor/next.config.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/services/pascal-editor/apps/editor/next.config.ts b/services/pascal-editor/apps/editor/next.config.ts index 3e44232ff..7e7ede40c 100644 --- a/services/pascal-editor/apps/editor/next.config.ts +++ b/services/pascal-editor/apps/editor/next.config.ts @@ -5,6 +5,7 @@ import type { NextConfig } from 'next' const configuredBasePath = process.env.NEXT_PUBLIC_PASCAL_BASE_PATH?.trim() ?? '' const basePath = configuredBasePath ? `/${configuredBasePath.replace(/^\/+|\/+$/g, '')}` : undefined const pascalRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..') +const workspaceModule = (name: string) => path.resolve(pascalRoot, 'node_modules', name) const nextConfig: NextConfig = { basePath, @@ -33,6 +34,16 @@ const nextConfig: NextConfig = { '@react-three/drei': './node_modules/@react-three/drei', }, }, + webpack: (config) => { + config.resolve.alias = { + ...config.resolve.alias, + 'react$': workspaceModule('react'), + 'three$': workspaceModule('three'), + '@react-three/fiber$': workspaceModule('@react-three/fiber'), + '@react-three/drei$': workspaceModule('@react-three/drei'), + } + return config + }, experimental: { serverActions: { bodySizeLimit: '100mb',