Skip to content

Commit

Permalink
Work
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Sep 21, 2023
1 parent ebd74cf commit 78b17d7
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const productionPlugins = [
];

module.exports = function getBabelConfig(api) {
const muiAliases = getMuiAliases('src', true);
const muiAliases = getMuiAliases({ type: 'src', isRelative: true });
const useESModules = api.env(['regressions', 'legacy', 'modern', 'stable', 'rollup']);

const presets = [
Expand Down
2 changes: 1 addition & 1 deletion docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ module.exports = withDocsInfra({
[
'babel-plugin-module-resolver',
{
alias: getMuiAliases('src'),
alias: getMuiAliases({ type: 'src' }),
},
],
],
Expand Down
11 changes: 5 additions & 6 deletions docs/public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,11 @@ https://v4.material-ui.com/* https://v4.mui.com/:splat 301!
## MUI X
## Unlike the store that expect to be hosted under a subfolder,
## MUI X is configured to be hosted at the root.
/static/x/* https://docs-next--material-ui-x.netlify.app/static/x/:splat 200
/static/* https://mui.com/static/:splat 200
/x/_next/* https://docs-next--material-ui-x.netlify.app/_next/:splat 200
/x/* https://docs-next--material-ui-x.netlify.app/x/:splat 200
/r/x-* https://docs-next--material-ui-x.netlify.app/r/x-:splat 200
/:lang/x/* https://docs-next--material-ui-x.netlify.app/:lang/x/:splat 200
/static/x/* https://material-ui-x.netlify.app/static/x/:splat 200
/x/_next/* https://material-ui-x.netlify.app/_next/:splat 200
/x/* https://material-ui-x.netlify.app/x/:splat 200
/r/x-* https://material-ui-x.netlify.app/r/x-:splat 200
/:lang/x/* https://material-ui-x.netlify.app/:lang/x/:splat 200

## MUI Toolpad
/static/toolpad/* https://mui-toolpad-docs.netlify.app/static/toolpad/:splat 200
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/productCore/CoreProducts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const content = [
// logo:
title: 'Base UI',
description:
"A library of unstyled React UI components and hooks. With Base UI, you gain complete control over your app's CSS and accessibility features.",
'A library of unstyled React UI components and hooks. With Base UI, you gain complete control over your app\'s CSS and accessibility features.',
link: '/base-ui/',
},
{
Expand Down
3 changes: 1 addition & 2 deletions docs/src/components/productDesignKit/DesignKitHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ export default function TemplateHero() {
}),
})}
>
<IconImage width={28} height={28} loading="eager" name="product-designkits" /> Design
kits
<IconImage width={28} height={28} loading="eager" name="product-designkits" /> Design kits
</Typography>
<Typography variant="h1" sx={{ my: 2, maxWidth: 500 }}>
Material UI
Expand Down
4 changes: 2 additions & 2 deletions examples/base-ui-cra/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default function App() {
<div className="box">
<h1>Base UI + Create React App scaffold (JavaScript)</h1>
<div className="item">
<a href="https://mui.com/base-ui/">Base UI</a> is a library of unstyled React UI components
and hooks.
<a href="https://mui.com/base-ui/">Base UI</a> is a library of
unstyled React UI components and hooks.
</div>
<div className="item">
<a href="https://create-react-app.dev/">Create React App</a> is a framework for quickly
Expand Down
7 changes: 4 additions & 3 deletions scripts/muiAliases.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const path = require('path');

/**
* @param {'build' | 'src'} type Define if the target should be the built version or the source.
* @param {boolean} isRelative If `true` the path will be relative to the repository root.
* @param {object} params The parameters of the function.
* @param {'build' | 'src'} params.type Define if the target should be the built version or the source.
* @param {boolean | undefined} params.isRelative If `true` the path will be relative to the repository root.
*/
function getMuiAliases(type, isRelative = false) {
function getMuiAliases({ type, isRelative = false }) {
const workspaceRoot = path.join(__dirname, '..');

const resolveAliasPath = (aliasPath) => {
Expand Down
4 changes: 2 additions & 2 deletions scripts/sizeSnapshot/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function createWebpackConfig(entry, environment) {
const configuration = {
// ideally this would be computed from the bundles peer dependencies
// Ensure that `react` as well as `react/*` are considered externals but not `react*`
externals: /^(date-fns|dayjs|luxon|moment|react|react-dom)(\/.*)?$/,
externals: /^(react|react-dom)(\/.*)?$/,
mode: 'production',
optimization: {
concatenateModules,
Expand Down Expand Up @@ -209,7 +209,7 @@ function createWebpackConfig(entry, environment) {
}),
],
resolve: {
alias: getMuiAliases('build'),
alias: getMuiAliases({ type: 'build' }),
},
entry: { [entry.id]: path.join(workspaceRoot, entry.path) },
// TODO: 'browserslist:modern'
Expand Down
2 changes: 1 addition & 1 deletion webpackBaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
context: path.resolve(__dirname),
resolve: {
modules: [__dirname, 'node_modules'],
alias: getMuiAliases('src'),
alias: getMuiAliases({ type: 'src' }),
extensions: ['.js', '.ts', '.tsx', '.d.ts'],
},
};

0 comments on commit 78b17d7

Please sign in to comment.