diff --git a/scripts/rollup/build.js b/scripts/rollup/build.js index ec0cc2c1754bb..c629ed509a7a4 100644 --- a/scripts/rollup/build.js +++ b/scripts/rollup/build.js @@ -410,7 +410,7 @@ function getPlugins( // Note that this plugin must be called after closure applies DCE. isProduction && stripUnusedImports(pureExternalModules), // Add the whitespace back if necessary. - shouldStayReadable && prettier({parser: 'babylon'}), + shouldStayReadable && prettier({parser: 'babel'}), // License and haste headers, top-level `if` blocks. { transformBundle(source) { diff --git a/scripts/shared/__tests__/evalToString-test.js b/scripts/shared/__tests__/evalToString-test.js index b920eaadb94dd..3f6c3adbb372a 100644 --- a/scripts/shared/__tests__/evalToString-test.js +++ b/scripts/shared/__tests__/evalToString-test.js @@ -7,10 +7,9 @@ 'use strict'; const evalToString = require('../evalToString'); -const babylon = require('babylon'); +const parser = require('@babel/parser'); -const parse = source => - babylon.parse(`(${source});`).program.body[0].expression; // quick way to get an exp node +const parse = source => parser.parse(`(${source});`).program.body[0].expression; // quick way to get an exp node const parseAndEval = source => evalToString(parse(source));