File tree 2 files changed +5
-11
lines changed
2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -2200,6 +2200,10 @@ export function projectContentsSameForRefreshRequire(
2200
2200
} else {
2201
2201
for ( const [ filename , oldProjectTree ] of Object . entries ( oldProjectContents ) ) {
2202
2202
const newProjectTree = newProjectContents [ filename ]
2203
+ // No need to check these further if they have the same reference.
2204
+ if ( oldProjectTree === newProjectTree ) {
2205
+ continue
2206
+ }
2203
2207
// If the file can't be found in the other tree, the imports are not the same.
2204
2208
if ( newProjectTree == null ) {
2205
2209
return false
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import type {
31
31
NodeModules ,
32
32
} from '../../core/shared/project-file-types'
33
33
import { importAlias , importDetails , importsResolution } from '../../core/shared/project-file-types'
34
- import { walkContentsTreeForParseSuccess , type ProjectContentTreeRoot } from '../assets'
34
+ import type { ProjectContentTreeRoot } from '../assets'
35
35
import type { BuiltInDependencies } from '../../core/es-modules/package-manager/built-in-dependencies-list'
36
36
import { withUnderlyingTarget } from './store/editor-state'
37
37
import * as EP from '../../core/shared/element-path'
@@ -366,13 +366,3 @@ function removeImportDetails(
366
366
importedFromWithin : importedFromWithin ,
367
367
}
368
368
}
369
-
370
- export function getProjectImports ( projectContents : ProjectContentTreeRoot ) : {
371
- [ filename : string ] : Imports
372
- } {
373
- let result : { [ filename : string ] : Imports } = { }
374
- walkContentsTreeForParseSuccess ( projectContents , ( filePath , parseSuccess ) => {
375
- result [ filePath ] = parseSuccess . imports
376
- } )
377
- return result
378
- }
You can’t perform that action at this time.
0 commit comments