File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
packages/open-next/src/build Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ const EXCLUDED_PACKAGES = [
4545 "next/dist/compiled/amphtml-validator" ,
4646] ;
4747
48- function isExcluded ( srcPath : string ) : string | undefined {
49- return EXCLUDED_PACKAGES . find ( ( excluded ) =>
48+ function isExcluded ( srcPath : string ) : boolean {
49+ return EXCLUDED_PACKAGES . some ( ( excluded ) =>
5050 srcPath . match ( getCrossPlatformPathRegex ( `/node_modules/${ excluded } /` ) ) ,
5151 ) ;
5252}
@@ -254,17 +254,10 @@ File ${serverPath} does not exist
254254
255255 // Only files that are actually copied
256256 const tracedFiles : string [ ] = [ ] ;
257- // Packages that are excluded and not copied
258- const excludedPackages = new Set < string > ( ) ;
259257 //Actually copy the files
260258 filesToCopy . forEach ( ( to , from ) => {
261259 // We don't want to copy excluded packages (e.g. sharp)
262- const excluded = isExcluded ( from ) ;
263- if ( excluded ) {
264- if ( excluded && ! excludedPackages . has ( excluded ) ) {
265- logger . debug ( "Skipping excluded package:" , excluded ) ;
266- excludedPackages . add ( excluded ) ;
267- }
260+ if ( isExcluded ( from ) ) {
268261 return ;
269262 }
270263 tracedFiles . push ( to ) ;
You can’t perform that action at this time.
0 commit comments