Change build from babylon to babel (#18015)

This commit is contained in:
Dominic Gannaway
2020-02-11 11:56:26 +00:00
committed by GitHub
parent df5faddcc2
commit 42918f40aa
2 changed files with 3 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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));