mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-25 00:33:08 +00:00
feat: Batch dev server logs and fix React module resolution order
This commit is contained in:
@@ -248,16 +248,12 @@ export default defineConfig(({ command }) => {
|
||||
{ find: '@', replacement: path.resolve(__dirname, './src') },
|
||||
// Force ALL React imports (including from nested deps like zustand@4 inside
|
||||
// @xyflow/react) to resolve to a single copy.
|
||||
// Explicit subpath aliases must come BEFORE the broad regex so Vite's
|
||||
// first-match-wins resolution applies the specific match first.
|
||||
{
|
||||
find: /^react-dom(\/|$)/,
|
||||
replacement: path.resolve(__dirname, '../../node_modules/react-dom') + '/',
|
||||
},
|
||||
{
|
||||
find: /^react(\/|$)/,
|
||||
replacement: path.resolve(__dirname, '../../node_modules/react') + '/',
|
||||
},
|
||||
// Explicit subpath aliases avoid mixed module IDs between bare imports and
|
||||
// optimized deps (e.g. react/jsx-runtime), which can manifest as duplicate React.
|
||||
{
|
||||
find: 'react/jsx-runtime',
|
||||
replacement: path.resolve(__dirname, '../../node_modules/react/jsx-runtime.js'),
|
||||
@@ -266,6 +262,10 @@ export default defineConfig(({ command }) => {
|
||||
find: 'react/jsx-dev-runtime',
|
||||
replacement: path.resolve(__dirname, '../../node_modules/react/jsx-dev-runtime.js'),
|
||||
},
|
||||
{
|
||||
find: /^react(\/|$)/,
|
||||
replacement: path.resolve(__dirname, '../../node_modules/react') + '/',
|
||||
},
|
||||
],
|
||||
dedupe: ['react', 'react-dom', 'zustand', 'use-sync-external-store', '@xyflow/react'],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user