File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/nextjs/src/config Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -625,6 +625,9 @@ function addFilesToExistingEntryPoint(
625625
626626 if ( typeof currentEntryPoint === 'string' || Array . isArray ( currentEntryPoint ) ) {
627627 newEntryPoint = arrayify ( currentEntryPoint ) ;
628+ if ( newEntryPoint . some ( entry => filesToInsert . includes ( entry ) ) ) {
629+ return ;
630+ }
628631
629632 if ( isDevMode ) {
630633 // Inserting at beginning breaks dev mode so we insert at the end
@@ -638,6 +641,9 @@ function addFilesToExistingEntryPoint(
638641 else if ( typeof currentEntryPoint === 'object' && 'import' in currentEntryPoint ) {
639642 const currentImportValue = currentEntryPoint . import ;
640643 const newImportValue = arrayify ( currentImportValue ) ;
644+ if ( newImportValue . some ( entry => filesToInsert . includes ( entry ) ) ) {
645+ return ;
646+ }
641647
642648 if ( isDevMode ) {
643649 // Inserting at beginning breaks dev mode so we insert at the end
You can’t perform that action at this time.
0 commit comments