[docs] Shift aliasing responsibilities from babel to webpack#33199
[docs] Shift aliasing responsibilities from babel to webpack#33199Janpot wants to merge 14 commits intomui:masterfrom
Conversation
|
| test: /\.(js|mjs|jsx)$/, | ||
| resourceQuery: { not: [/raw/] }, | ||
| include: | ||
| /node_modules(\/|\\)(notistack|@mui(\/|\\)x-data-grid|@mui(\/|\\)x-data-grid-pro|@mui(\/|\\)x-license-pro|@mui(\/|\\)x-data-grid-generator|@mui(\/|\\)x-date-pickers-pro|@mui(\/|\\)x-date-pickers)/, |
There was a problem hiding this comment.
We will need to test that notistack and x-data-grid are still using the local version of Material UI.
There was a problem hiding this comment.
Seems to work for x-data-grid (I left the externals in). Inspected notistack, the version installed doesn't seem to be importing any @mui/ packages anywhere. It added us in peerDependencies for some reason though.
Screen.Recording.2022-06-17.at.23.43.09.mov
|
What about scripts executed with babel-node? There is a couple of them that import from @mui/ scoped packages. They may need the aliases defined in Babel config. |
|
This PR only changes it for the docs. We can phase out babel-node in separate efforts |
michaldudak
left a comment
There was a problem hiding this comment.
What about scripts executed with babel-node? There is a couple of them that import from @mui/ scoped packages. They may need the aliases defined in Babel config.
Actually, the scripts will just use linked packages from yarn workspaces, so they should work just fine.
| '@mui/base': path.resolve(__dirname, '../packages/mui-base/src'), | ||
| '@mui/material-next': path.resolve(__dirname, '../packages/mui-material-next/src'), | ||
| '@mui/joy': path.resolve(__dirname, '../packages/mui-joy/src'), | ||
| docs: path.resolve(__dirname, './'), |
There was a problem hiding this comment.
docs are likely not necessary to be specified here. Workspace linking should work just fine.
|
@michaldudak FYI this PR may be superseded by #35197 |
next-transpile-modulescompile workspace dependenciesThis avoids the need to specify the aliasing again for transpiled modules.
In an ideal world we'd avoid aliasing altogether. In Toolpad we avoid them by building and watching each of the workspaces separately.