mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Change build from babylon to babel (#18015)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user