@@ -21,7 +21,6 @@ import rollupReplace from "@rollup/plugin-replace";
2121import rollupTerser from "@rollup/plugin-terser" ;
2222import rollupDts from "rollup-plugin-dts" ;
2323import { Worker as JestWorker } from "jest-worker" ;
24- import { Glob } from "glob" ;
2524import { patchErrorInfo } from "./packages/babel-parser/scripts/build-error-info.ts" ;
2625
2726import rollupBabelSource from "./scripts/rollup-plugin-babel-source.ts" ;
@@ -41,6 +40,13 @@ const defaultSourcesGlob = [
4140 `${ defaultPackagesGlob } /src/**/{*.js,*.cjs,!(*.d).ts,!(*.d).cts,!(*.d).mts}` ,
4241 "!./packages/babel-helpers/src/helpers/*" ,
4342] ;
43+ function globDefaultSources ( ) {
44+ return fs
45+ . globSync ( defaultSourcesGlob [ 0 ] , {
46+ exclude : [ "./packages/babel-helpers/src/helpers/*" ] ,
47+ } )
48+ . map ( file => file . replaceAll ( "\\" , "/" ) ) ;
49+ }
4450
4551const babelStandalonePluginConfigGlob =
4652 "./packages/babel-standalone/scripts/pluginConfig.json" ;
@@ -271,13 +277,12 @@ function createWorker(useWorker: boolean): any {
271277
272278async function buildBabel ( useWorker : boolean , ignore : PackageInfo [ ] = [ ] ) {
273279 const worker = await createWorker ( useWorker ) ;
274- const files = new Glob ( defaultSourcesGlob , {
275- ignore : ignore . map ( p => `${ p . src } /**` ) ,
276- posix : true ,
277- } ) ;
278-
279280 const promises = [ ] ;
280- for await ( const file of files ) {
281+ for ( const file of globDefaultSources ( ) ) {
282+ if ( ignore . some ( pkg => file . startsWith ( `${ pkg . src } /` ) ) ) {
283+ continue ;
284+ }
285+
281286 // @example ./packages/babel-parser/src/index.js
282287 const dest = "./" + mapSrcToLib ( file ) ;
283288 promises . push (
@@ -997,7 +1002,7 @@ gulp.task("generate-runtime-helpers", async () => {
9971002gulp . task ( "generate-standalone" , ( ) => generateStandalone ( ) ) ;
9981003
9991004gulp . task ( "materialize-babel-8-src" , ( ) =>
1000- applyBabelToGlob ( new Glob ( defaultSourcesGlob , { posix : true } ) , {
1005+ applyBabelToGlob ( globDefaultSources ( ) , {
10011006 plugins : [
10021007 [
10031008 babelPluginToggleBooleanFlag ,
@@ -1033,8 +1038,8 @@ gulp.task("materialize-babel-8-src", () =>
10331038
10341039gulp . task ( "materialize-babel-8-tests" , ( ) =>
10351040 applyBabelToGlob (
1036- new Glob ( `${ defaultPackagesGlob } /test/**/{*.js,*.cjs,*.mjs}` , {
1037- ignore : [
1041+ fs . globSync ( `${ defaultPackagesGlob } /test/**/{*.js,*.cjs,*.mjs}` , {
1042+ exclude : [
10381043 `**/test/fixtures/**` ,
10391044 `**/test/regenerator-fixtures/**` ,
10401045 `**/test/tmp/**` ,
0 commit comments