@@ -4,10 +4,10 @@ import { dirname, join as joinPath, resolve as resolvePath } from 'node:path'
44import { fileURLToPath } from 'node:url'
55
66import { findUp , pathExists } from 'find-up'
7- import glob from 'glob'
87import postcss from 'postcss'
98import postcssRtlCss from 'postcss-rtlcss'
109import semverCompare from 'semver-compare'
10+ import { globSync } from 'tinyglobby'
1111
1212import { Assets } from './assets'
1313import type { BuildMode , LangConfig } from './config'
@@ -195,9 +195,8 @@ async function buildLang(
195195 // Copy all other assets from the "shared src" directory. Note that glob paths
196196 // have forward slashes only, so convert backslashes here.
197197 const sharedSrcPath = context . config . sourceDir . replaceAll ( '\\' , '/' )
198- const sharedSrcFiles = glob . sync ( `${ sharedSrcPath } /*` , { nodir : true } )
199- for ( const f of sharedSrcFiles ) {
200- const relPath = f . replace ( `${ sharedSrcPath } /` , '' )
198+ const sharedSrcFiles = globSync ( `${ sharedSrcPath } /*` , { cwd : sharedSrcPath , onlyFiles : true } )
199+ for ( const relPath of sharedSrcFiles ) {
201200 if ( ! relPath . endsWith ( '.html' ) && ! relPath . endsWith ( 'base.css' ) ) {
202201 copyToBase ( context . config . sourceDir , relPath )
203202 }
@@ -215,9 +214,8 @@ async function buildLang(
215214 '/'
216215 )
217216 const langPath = `${ localizationDir } /${ lang } `
218- const files = glob . sync ( `${ langPath } /images/**/*` , { nodir : true } )
219- for ( const f of files ) {
220- const relPath = f . replace ( `${ langPath } /` , '' )
217+ const files = globSync ( `${ langPath } /images/**/*` , { cwd : langPath , onlyFiles : true } )
218+ for ( const relPath of files ) {
221219 assets . copyWithHash ( resolvePath ( langPath ) , relPath , context . outDir )
222220 }
223221 }
0 commit comments