diff --git a/examples/cdn/README.md b/examples/cdn/README.md index c9082e8e9f933b..5dba2e1f523e59 100644 --- a/examples/cdn/README.md +++ b/examples/cdn/README.md @@ -22,6 +22,8 @@ which is great for prototyping. We discourage using this approach in production the client has to download the entire library, regardless of which components are actually used, affecting performance and bandwidth utilisation. +[The live preview.](https://codesandbox.io/s/github/mui-org/material-ui/tree/master/examples/cdn) + ## UMD releases We are providing two Universal Module Definition (UMD) files: diff --git a/examples/cdn/package.json b/examples/cdn/package.json new file mode 100644 index 00000000000000..34cc6c11a56874 --- /dev/null +++ b/examples/cdn/package.json @@ -0,0 +1,7 @@ +{ + "name": "cdn", + "version": "3.0.0", + "private": true, + "dependencies": {}, + "scripts": {} +} diff --git a/packages/material-ui-utils/src/componentPropType.js b/packages/material-ui-utils/src/componentPropType.js index 843b22be22d0a6..08b74bc12c6087 100644 --- a/packages/material-ui-utils/src/componentPropType.js +++ b/packages/material-ui-utils/src/componentPropType.js @@ -1,4 +1,4 @@ -const ReactIs = require('react-is'); +import { isValidElementType } from 'react-is'; /** * A factory that returns a propTypes validator that only accepts values that @@ -25,7 +25,7 @@ function createComponentProp(isRequired) { `The ${location} \`${propName}\` is marked as required in \`${componentName}\`, ` + `but its value is \`${typeof prop}\`.`; } - } else if (!ReactIs.isValidElementType(prop)) { + } else if (!isValidElementType(prop)) { const preciseType = typeof prop; message = `Invalid ${location} \`${propName}\` of type \`${preciseType}\` ` + diff --git a/packages/material-ui/scripts/rollup.config.js b/packages/material-ui/scripts/rollup.config.js index ffbc165032dbba..5c99a27d0d7305 100644 --- a/packages/material-ui/scripts/rollup.config.js +++ b/packages/material-ui/scripts/rollup.config.js @@ -21,6 +21,9 @@ const babelOptions = { const commonjsOptions = { ignoreGlobal: true, include: /node_modules/, + namedExports: { + '../../node_modules/react-is/index.js': ['isValidElementType'], + }, }; export default [