From 816c1643d86cb0d4a91cd5d455aaf296d33c7aee Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 17 Mar 2020 22:33:36 +0100 Subject: [PATCH] skip rollup warning --- packages/material-ui/scripts/rollup.config.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/material-ui/scripts/rollup.config.js b/packages/material-ui/scripts/rollup.config.js index fc02426ceea1e9..6b5bd77a178874 100644 --- a/packages/material-ui/scripts/rollup.config.js +++ b/packages/material-ui/scripts/rollup.config.js @@ -41,7 +41,21 @@ const commonjsOptions = { }; function onwarn(warning) { - throw Error(warning.message); + let ignoreWarning = false; + if ( + warning.code === 'UNUSED_EXTERNAL_IMPORT' && + warning.source === 'react' && + warning.names.filter(identifier => identifier !== 'useDebugValue').length === 0 + ) { + // skip + // import * as React from 'react' + // if (__DEV__) React.useDebugValue() + ignoreWarning = true; + } + + if (!ignoreWarning) { + throw Error(warning.message); + } } export default [