@@ -19,10 +19,10 @@ const ignored_basenames = ['.DS_Store', 'LICENSE'];
19
19
const ignored_extensions = [ '.d.ts' , '.map' ] ;
20
20
const ignored_directories = [ '.svelte-kit' , 'node_modules/.bin' , 'node_modules/rollup/dist/shared' ] ;
21
21
22
- const ignored_files = new Set ( [
23
- ' node_modules/svelte/compiler.js' ,
24
- ' node_modules/@esbuild/darwin-arm64 /bin/esbuild'
25
- ] ) ;
22
+ const ignored_files = [
23
+ / ^ n o d e _ m o d u l e s \ /s v e l t e \ /c o m p i l e r \ .j s $ / ,
24
+ / ^ n o d e _ m o d u l e s \ /@ e s b u i l d \/ . + \ /b i n \ /e s b u i l d $ /
25
+ ] ;
26
26
27
27
for ( const file of glob ( '**' , { cwd, filesOnly : true , dot : true } ) . map ( ( file ) =>
28
28
file . replaceAll ( '\\' , '/' )
@@ -31,8 +31,9 @@ for (const file of glob('**', { cwd, filesOnly: true, dot: true }).map((file) =>
31
31
if ( ignored_basenames . find ( ( basename ) => file . endsWith ( '/' + basename ) ) ) continue ;
32
32
if ( ignored_directories . find ( ( dir ) => file . startsWith ( dir + '/' ) ) ) continue ;
33
33
34
- if ( ignored_files . has ( file ) ) {
35
- ignored_files . delete ( file ) ;
34
+ const ignored_index = ignored_files . findIndex ( ( pattern ) => pattern . test ( file ) ) ;
35
+ if ( ignored_index !== - 1 ) {
36
+ ignored_files . splice ( ignored_index , 1 ) ;
36
37
continue ;
37
38
}
38
39
@@ -50,7 +51,7 @@ for (const file of glob('**', { cwd, filesOnly: true, dot: true }).map((file) =>
50
51
zip . addFile ( file , fs . readFileSync ( `${ cwd } /${ file } ` ) ) ;
51
52
}
52
53
53
- if ( ignored_files . size > 0 ) {
54
+ if ( ignored_files . length > 0 ) {
54
55
throw new Error ( `expected to find ${ Array . from ( ignored_files ) . join ( ', ' ) } ` ) ;
55
56
}
56
57
0 commit comments