Skip to content

Commit

Permalink
Merge pull request #10499 from marmelab/fix-demo-build
Browse files Browse the repository at this point in the history
Fix demo build
  • Loading branch information
fzaninotto authored Feb 6, 2025
2 parents cbfb0d1 + 8eef591 commit 6a56460
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion examples/demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { visualizer } from 'rollup-plugin-visualizer';
import preserveDirectives from 'rollup-preserve-directives';

// https://vitejs.dev/config/
export default defineConfig(async () => {
export default defineConfig(async ({ mode }) => {
const packages = fs.readdirSync(path.resolve(__dirname, '../../packages'));
const aliases: Record<string, string> = {
'data-generator-retail': path.resolve(
Expand Down Expand Up @@ -68,6 +68,21 @@ export default defineConfig(async () => {
// find: 'scheduler/tracing',
// replacement: 'scheduler/tracing-profiling',
// },
// The 2 next aliases are needed to avoid having multiple react-router instances
{
find: 'react-router-dom',
replacement: path.resolve(
__dirname,
`node_modules/react-router/dist/${mode === 'production' ? 'production' : 'development'}/index.mjs`
),
},
{
find: 'react-router',
replacement: path.resolve(
__dirname,
`node_modules/react-router/dist/${mode === 'production' ? 'production' : 'development'}/index.mjs`
),
},
// The 2 next aliases are needed to avoid having multiple MUI instances
{
find: '@mui/material',
Expand Down

0 comments on commit 6a56460

Please sign in to comment.