File tree 1 file changed +9
-9
lines changed
packages/@css-blocks/glimmer/src
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { ResolverConfiguration } from "@glimmer/resolver";
11
11
import { AST , preprocess , traverse } from "@glimmer/syntax" ;
12
12
import { TemplateIntegrationOptions } from "@opticss/template-api" ;
13
13
import * as debugGenerator from "debug" ;
14
+ import * as fs from "fs" ;
14
15
15
16
import { ElementAnalyzer } from "./ElementAnalyzer" ;
16
17
import { isEmberBuiltIn } from "./EmberBuiltins" ;
@@ -81,15 +82,14 @@ export class GlimmerAnalyzer extends Analyzer<TEMPLATE_TYPE> {
81
82
}
82
83
83
84
private async resolveBlock ( dir : string , componentName : string ) : Promise < Block | undefined > {
84
- try {
85
- let blockFile = await this . resolver . stylesheetFor ( dir , componentName ) ;
86
- if ( ! blockFile ) {
87
- this . debug ( `Analyzing ${ componentName } . No block for component. Returning empty analysis.` ) ;
88
- return undefined ;
89
- }
90
- return await this . blockFactory . getBlockFromPath ( blockFile . path ) ;
91
- } catch ( e ) {
92
- this . debug ( e ) ;
85
+ let blockFile = await this . resolver . stylesheetFor ( dir , componentName ) ;
86
+ if ( ! blockFile ) {
87
+ this . debug ( `Analyzing ${ componentName } . No block for component. Returning empty analysis.` ) ;
88
+ return undefined ;
89
+ }
90
+ if ( fs . existsSync ( blockFile . path ) ) {
91
+ return this . blockFactory . getBlockFromPath ( blockFile . path ) ;
92
+ } else {
93
93
this . debug ( `Analyzing ${ componentName } . No block for component. Returning empty analysis.` ) ;
94
94
return undefined ;
95
95
}
You can’t perform that action at this time.
0 commit comments