File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
bazel/ts_project/strict_deps Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -52,16 +52,18 @@ function checkPathsForMatch(moduleSpecifier: string, paths?: ts.MapLike<string[]
5252 return false ;
5353}
5454
55+ /** The list of known package names that end with extensions and need to be special cased. */
56+ const knownModuleSpecifiersWithExtensions = new Set ( [ 'highlight.js' , 'zone.js' ] ) ;
57+
5558for ( const fileExecPath of manifest . testFiles ) {
5659 const content = await fs . readFile ( fileExecPath , 'utf8' ) ;
5760 const sf = ts . createSourceFile ( fileExecPath , content , ts . ScriptTarget . ESNext , true ) ;
5861 const imports = getImportsInSourceFile ( sf ) ;
5962
6063 for ( const i of imports ) {
61- const moduleSpecifier =
62- i . moduleSpecifier === 'zone.js'
63- ? 'zone.js'
64- : i . moduleSpecifier . replace ( extensionRemoveRegex , '' ) ;
64+ const moduleSpecifier = knownModuleSpecifiersWithExtensions . has ( i . moduleSpecifier )
65+ ? i . moduleSpecifier
66+ : i . moduleSpecifier . replace ( extensionRemoveRegex , '' ) ;
6567 // When the module specified is the file itself this is always a valid dep.
6668 if ( i . moduleSpecifier === '' ) {
6769 continue ;
You can’t perform that action at this time.
0 commit comments