@@ -25,24 +25,17 @@ const getSerializeJavascript = memoize(() =>
25
25
require ( "serialize-javascript" ) ,
26
26
) ;
27
27
28
- const getFastGlob = memoize ( ( ) =>
28
+ const getTinyGlobby = memoize ( ( ) =>
29
29
// eslint-disable-next-line global-require
30
- require ( "fast-glob " ) ,
30
+ require ( "tinyglobby " ) ,
31
31
) ;
32
32
33
- const getGlobby = memoize ( async ( ) => {
34
- // @ts -ignore
35
- const { globby } = await import ( "globby" ) ;
36
-
37
- return globby ;
38
- } ) ;
39
-
40
33
/** @typedef {import("schema-utils/declarations/validate").Schema } Schema */
41
34
/** @typedef {import("webpack").Compiler } Compiler */
42
35
/** @typedef {import("webpack").Compilation } Compilation */
43
36
/** @typedef {import("webpack").WebpackError } WebpackError */
44
37
/** @typedef {import("webpack").Asset } Asset */
45
- /** @typedef {import("globby ").Options } GlobbyOptions */
38
+ /** @typedef {import("tinyglobby ").GlobOptions } GlobbyOptions */
46
39
/** @typedef {ReturnType<Compilation["getLogger"]> } WebpackLogger */
47
40
/** @typedef {ReturnType<Compilation["getCache"]> } CacheFacade */
48
41
/** @typedef {ReturnType<ReturnType<Compilation["getCache"]>["getLazyHashedEtag"]> } Etag */
@@ -267,7 +260,7 @@ class CopyPlugin {
267
260
268
261
/**
269
262
* @private
270
- * @param {typeof import("globby ").globby } globby
263
+ * @param {typeof import("tinyglobby ").glob } globby
271
264
* @param {Compiler } compiler
272
265
* @param {Compilation } compilation
273
266
* @param {WebpackLogger } logger
@@ -339,10 +332,10 @@ class CopyPlugin {
339
332
340
333
/** @type {GlobbyOptions } */
341
334
const globOptions = {
335
+ absolute : true ,
342
336
followSymbolicLinks : true ,
343
337
...( pattern . globOptions || { } ) ,
344
338
cwd : pattern . context ,
345
- objectMode : false ,
346
339
onlyFiles : true ,
347
340
} ;
348
341
@@ -359,7 +352,7 @@ class CopyPlugin {
359
352
360
353
pattern . context = absoluteFrom ;
361
354
glob = path . posix . join (
362
- getFastGlob ( ) . escapePath (
355
+ getTinyGlobby ( ) . escapePath (
363
356
getNormalizePath ( ) ( path . resolve ( absoluteFrom ) ) ,
364
357
) ,
365
358
"**/*" ,
@@ -376,7 +369,7 @@ class CopyPlugin {
376
369
logger . debug ( `added '${ absoluteFrom } ' as a file dependency` ) ;
377
370
378
371
pattern . context = path . dirname ( absoluteFrom ) ;
379
- glob = getFastGlob ( ) . escapePath (
372
+ glob = getTinyGlobby ( ) . escapePath (
380
373
getNormalizePath ( ) ( path . resolve ( absoluteFrom ) ) ,
381
374
) ;
382
375
@@ -397,7 +390,7 @@ class CopyPlugin {
397
390
glob = path . isAbsolute ( originalFrom )
398
391
? originalFrom
399
392
: path . posix . join (
400
- getFastGlob ( ) . escapePath (
393
+ getTinyGlobby ( ) . escapePath (
401
394
getNormalizePath ( ) ( path . resolve ( pattern . context ) ) ,
402
395
) ,
403
396
originalFrom ,
@@ -815,7 +808,7 @@ class CopyPlugin {
815
808
const cache = compilation . getCache ( "CopyWebpackPlugin" ) ;
816
809
817
810
/**
818
- * @type {typeof import("globby ").globby }
811
+ * @type {typeof import("tinyglobby ").glob }
819
812
*/
820
813
let globby ;
821
814
@@ -827,7 +820,7 @@ class CopyPlugin {
827
820
async ( unusedAssets , callback ) => {
828
821
if ( typeof globby === "undefined" ) {
829
822
try {
830
- globby = await getGlobby ( ) ;
823
+ globby = await getTinyGlobby ( ) . glob ;
831
824
} catch ( error ) {
832
825
callback ( /** @type {Error } */ ( error ) ) ;
833
826
0 commit comments