@@ -17,8 +17,8 @@ const {
1717} = require ( './constants' ) ;
1818const { execSync} = require ( 'child_process' ) ;
1919const fs = require ( 'fs' ) ;
20- const glob = require ( 'glob' ) ;
2120const path = require ( 'path' ) ;
21+ const { globSync} = require ( 'tinyglobby' ) ;
2222const util = require ( 'util' ) ;
2323
2424/*::
@@ -142,7 +142,10 @@ async function createBuildStructure(
142142 // Now let's use glob to get the final list of files
143143 const sources = dependency . files . sources ;
144144 sources . forEach ( source => {
145- const sourceFiles = glob . sync ( source , { cwd : sourceFolder } ) ;
145+ const sourceFiles = globSync ( source , {
146+ cwd : sourceFolder ,
147+ expandDirectories : false ,
148+ } ) ;
146149 sourceFiles . forEach ( sourceFile => {
147150 const sourcePath = path . join ( sourceFolder , sourceFile ) ;
148151 const targetPath = path . join ( targetFolder , sourceFile ) ;
@@ -180,7 +183,10 @@ async function createHeaderStructure(
180183 // Now let's use glob to get the final list of files
181184 const headers = dependency . files . headers ;
182185 headers . forEach ( source => {
183- const sourceFiles = glob . sync ( source , { cwd : sourceFolder } ) ;
186+ const sourceFiles = globSync ( source , {
187+ cwd : sourceFolder ,
188+ expandDirectories : false ,
189+ } ) ;
184190 sourceFiles . forEach ( sourceFile => {
185191 // get source path
186192 const sourcePath = path . join ( sourceFolder , sourceFile ) ;
@@ -234,7 +240,10 @@ async function copyResources(
234240
235241 // Copy all resources
236242 resources . forEach ( source => {
237- const sourceFiles = glob . sync ( source , { cwd : rootFolder } ) ;
243+ const sourceFiles = globSync ( source , {
244+ cwd : rootFolder ,
245+ expandDirectories : false ,
246+ } ) ;
238247 sourceFiles . forEach ( sourceFile => {
239248 const sourcePath = path . resolve ( rootFolder , sourceFile ) ;
240249 const targetPath = path . join ( targetFolder , path . basename ( sourceFile ) ) ;
0 commit comments