Merge branch 'cw/review-tab-performance' into cw-merge-1772826318787
This commit is contained in:
@@ -5,11 +5,24 @@ import path from 'node:path';
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
// Alias react to the parent monorepo's copy, matching what @testing-library
|
||||
// loads react-dom from. This ensures React DOM and our components share the
|
||||
// same ReactSharedInternals and hook dispatcher — preventing null-dispatcher
|
||||
// errors when running tests from a git worktree.
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './apps/web/src'),
|
||||
react: path.resolve(__dirname, '../../../../node_modules/react'),
|
||||
'react-dom': path.resolve(__dirname, '../../../../node_modules/react-dom'),
|
||||
},
|
||||
dedupe: ['react', 'react-dom'],
|
||||
},
|
||||
test: {
|
||||
// Force react-dom and @testing-library through Vite's module graph so that
|
||||
// the resolve.alias for 'react-dom' applies (prevents parent-monorepo
|
||||
// react-dom loading a different React instance than our source files).
|
||||
deps: {
|
||||
inline: ['react-dom', '@testing-library/react'],
|
||||
},
|
||||
// Enable test globals (describe, it, expect without imports)
|
||||
globals: true,
|
||||
env: {
|
||||
|
||||
Reference in New Issue
Block a user