[babel 8] Type checking preset-react options (#12741)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
14
Gulpfile.mjs
14
Gulpfile.mjs
@@ -288,11 +288,18 @@ function buildRollup(packages, targetBrowsers) {
|
||||
input,
|
||||
external,
|
||||
onwarn(warning, warn) {
|
||||
if (warning.code !== "CIRCULAR_DEPENDENCY") {
|
||||
if (warning.code === "CIRCULAR_DEPENDENCY") return;
|
||||
if (warning.code === "UNUSED_EXTERNAL_IMPORT") {
|
||||
warn(warning);
|
||||
// https://github.com/babel/babel/pull/12011#discussion_r540434534
|
||||
throw new Error("Rollup aborted due to warnings above");
|
||||
return;
|
||||
}
|
||||
|
||||
// We use console.warn here since it prints more info than just "warn",
|
||||
// in case we want to stop throwing for a specific message.
|
||||
console.warn(warning);
|
||||
|
||||
// https://github.com/babel/babel/pull/12011#discussion_r540434534
|
||||
throw new Error("Rollup aborted due to warnings above");
|
||||
},
|
||||
plugins: [
|
||||
rollupBabelSource(),
|
||||
@@ -424,6 +431,7 @@ function copyDts(packages) {
|
||||
const libBundles = [
|
||||
"packages/babel-parser",
|
||||
"packages/babel-plugin-proposal-optional-chaining",
|
||||
"packages/babel-preset-react",
|
||||
"packages/babel-preset-typescript",
|
||||
"packages/babel-helper-member-expression-to-functions",
|
||||
"packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
|
||||
Reference in New Issue
Block a user