@@ -25,24 +25,17 @@ const getSerializeJavascript = memoize(() =>
2525 require ( "serialize-javascript" ) ,
2626) ;
2727
28- const getFastGlob = memoize ( ( ) =>
28+ const getTinyGlobby = memoize ( ( ) =>
2929 // eslint-disable-next-line global-require
30- require ( "fast-glob " ) ,
30+ require ( "tinyglobby " ) ,
3131) ;
3232
33- const getGlobby = memoize ( async ( ) => {
34- // @ts -ignore
35- const { globby } = await import ( "globby" ) ;
36-
37- return globby ;
38- } ) ;
39-
4033/** @typedef {import("schema-utils/declarations/validate").Schema } Schema */
4134/** @typedef {import("webpack").Compiler } Compiler */
4235/** @typedef {import("webpack").Compilation } Compilation */
4336/** @typedef {import("webpack").WebpackError } WebpackError */
4437/** @typedef {import("webpack").Asset } Asset */
45- /** @typedef {import("globby ").Options } GlobbyOptions */
38+ /** @typedef {import("tinyglobby ").GlobOptions } GlobbyOptions */
4639/** @typedef {ReturnType<Compilation["getLogger"]> } WebpackLogger */
4740/** @typedef {ReturnType<Compilation["getCache"]> } CacheFacade */
4841/** @typedef {ReturnType<ReturnType<Compilation["getCache"]>["getLazyHashedEtag"]> } Etag */
@@ -267,7 +260,7 @@ class CopyPlugin {
267260
268261 /**
269262 * @private
270- * @param {typeof import("globby ").globby } globby
263+ * @param {typeof import("tinyglobby ").glob } globby
271264 * @param {Compiler } compiler
272265 * @param {Compilation } compilation
273266 * @param {WebpackLogger } logger
@@ -339,10 +332,10 @@ class CopyPlugin {
339332
340333 /** @type {GlobbyOptions } */
341334 const globOptions = {
335+ absolute : true ,
342336 followSymbolicLinks : true ,
343337 ...( pattern . globOptions || { } ) ,
344338 cwd : pattern . context ,
345- objectMode : false ,
346339 onlyFiles : true ,
347340 } ;
348341
@@ -359,7 +352,7 @@ class CopyPlugin {
359352
360353 pattern . context = absoluteFrom ;
361354 glob = path . posix . join (
362- getFastGlob ( ) . escapePath (
355+ getTinyGlobby ( ) . escapePath (
363356 getNormalizePath ( ) ( path . resolve ( absoluteFrom ) ) ,
364357 ) ,
365358 "**/*" ,
@@ -376,7 +369,7 @@ class CopyPlugin {
376369 logger . debug ( `added '${ absoluteFrom } ' as a file dependency` ) ;
377370
378371 pattern . context = path . dirname ( absoluteFrom ) ;
379- glob = getFastGlob ( ) . escapePath (
372+ glob = getTinyGlobby ( ) . escapePath (
380373 getNormalizePath ( ) ( path . resolve ( absoluteFrom ) ) ,
381374 ) ;
382375
@@ -397,7 +390,7 @@ class CopyPlugin {
397390 glob = path . isAbsolute ( originalFrom )
398391 ? originalFrom
399392 : path . posix . join (
400- getFastGlob ( ) . escapePath (
393+ getTinyGlobby ( ) . escapePath (
401394 getNormalizePath ( ) ( path . resolve ( pattern . context ) ) ,
402395 ) ,
403396 originalFrom ,
@@ -815,7 +808,7 @@ class CopyPlugin {
815808 const cache = compilation . getCache ( "CopyWebpackPlugin" ) ;
816809
817810 /**
818- * @type {typeof import("globby ").globby }
811+ * @type {typeof import("tinyglobby ").glob }
819812 */
820813 let globby ;
821814
@@ -827,7 +820,7 @@ class CopyPlugin {
827820 async ( unusedAssets , callback ) => {
828821 if ( typeof globby === "undefined" ) {
829822 try {
830- globby = await getGlobby ( ) ;
823+ globby = await getTinyGlobby ( ) . glob ;
831824 } catch ( error ) {
832825 callback ( /** @type {Error } */ ( error ) ) ;
833826
0 commit comments