Skip to content

Commit b8bca0a

Browse files
authored
Merge pull request #10465 from marmelab/fix-tutorial-multiple-mui-packages
Fix tutorial has multiple conflicting MUI packages
2 parents b6cd03a + 9b02936 commit b8bca0a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

examples/tutorial/vite.config.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
import { defineConfig } from 'vite';
22
import react from '@vitejs/plugin-react';
3+
import path from 'path';
34

45
// https://vitejs.dev/config/
56
export default defineConfig({
67
plugins: [react()],
8+
resolve: {
9+
preserveSymlinks: true,
10+
alias: [
11+
// The 2 next aliases are needed to avoid having multiple MUI instances
12+
{
13+
find: '@mui/material',
14+
replacement: path.resolve(
15+
__dirname,
16+
'node_modules/@mui/material'
17+
),
18+
},
19+
{
20+
find: '@mui/icons-material',
21+
replacement: path.resolve(
22+
__dirname,
23+
'node_modules/@mui/icons-material'
24+
),
25+
},
26+
],
27+
},
728
});

0 commit comments

Comments
 (0)