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 = [
45
45
"next/dist/compiled/amphtml-validator" ,
46
46
] ;
47
47
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 ) =>
50
50
srcPath . match ( getCrossPlatformPathRegex ( `/node_modules/${ excluded } /` ) ) ,
51
51
) ;
52
52
}
@@ -254,17 +254,10 @@ File ${serverPath} does not exist
254
254
255
255
// Only files that are actually copied
256
256
const tracedFiles : string [ ] = [ ] ;
257
- // Packages that are excluded and not copied
258
- const excludedPackages = new Set < string > ( ) ;
259
257
//Actually copy the files
260
258
filesToCopy . forEach ( ( to , from ) => {
261
259
// 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 ) ) {
268
261
return ;
269
262
}
270
263
tracedFiles . push ( to ) ;
You can’t perform that action at this time.
0 commit comments