File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import {createEs2015LinkerPlugin} from '@angular/compiler-cli/linker/babel';
77import { NodeJSFileSystem , ConsoleLogger , LogLevel } from '@angular/compiler-cli' ;
88import fs from 'fs' ;
99import path from 'path' ;
10- import babel from '@babel/core' ;
10+ import { transformSync , traverse } from '@babel/core' ;
1111import { sync as globSync } from 'glob' ;
1212import chalk from 'chalk' ;
1313
@@ -78,15 +78,15 @@ function testPackage(pkg) {
7878 // Babel throws errors if the transformation fails. We catch these so that we
7979 // can print incompatible entry points with their errors at the end.
8080 try {
81- const { ast} = babel . transformSync ( fileContent , {
81+ const { ast} = transformSync ( fileContent , {
8282 ast : true ,
8383 filename : diskFilePath ,
8484 filenameRelative : debugFileName ,
8585 plugins : [ linkerPlugin ] ,
8686 } ) ;
8787
8888 // Naively check if there are any Angular declarations left that haven't been linked.
89- babel . traverse ( ast , {
89+ traverse ( ast , {
9090 Identifier : astPath => {
9191 if ( astPath . node . name . startsWith ( 'ɵɵngDeclare' ) ) {
9292 throw astPath . buildCodeFrameError (
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3- import babel from '@babel/core' ;
3+ import { transformAsync } from '@babel/core' ;
44import child_process from 'child_process' ;
55import esbuild from 'esbuild' ;
66import fs from 'fs' ;
@@ -173,7 +173,7 @@ function createLinkerEsbuildPlugin() {
173173 build . onLoad ( { filter : / f e s m 2 0 2 2 / } , async args => {
174174 const filePath = args . path ;
175175 const content = await fs . promises . readFile ( filePath , 'utf8' ) ;
176- const { code} = await babel . transformAsync ( content , {
176+ const { code} = await transformAsync ( content , {
177177 filename : filePath ,
178178 compact : false ,
179179 plugins : [ [ '@angular/compiler-cli/linker/babel' , { linkerJitMode : true } ] ] ,
You can’t perform that action at this time.
0 commit comments