Skip to content

Commit

Permalink
skip rollup warning
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Mar 17, 2020
1 parent 1d1ee90 commit 816c164
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/material-ui/scripts/rollup.config.js
Expand Up @@ -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 [
Expand Down

0 comments on commit 816c164

Please sign in to comment.