File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ const EVENT_HANDLER_METHODS = [
4949function transform ( componentPath ) {
5050 let source = fs . readFileSync ( componentPath , 'utf8' ) ;
5151
52+ let templatePath = guessTemplatePath ( componentPath ) ;
53+ if ( ! fs . existsSync ( templatePath ) ) {
54+ throw new SilentError ( `Could not find template at ${ templatePath } ` ) ;
55+ }
56+ debug ( `${ componentPath } : templatePath: %o` , templatePath ) ;
57+
58+ let template = fs . readFileSync ( templatePath , 'utf8' ) ;
59+
5260 let root = j ( source ) ;
5361
5462 // find `export default Component.extend({ ... });` AST node
@@ -123,13 +131,6 @@ function transform(componentPath) {
123131 let classNameBindings = findClassNameBindings ( properties ) ;
124132 debug ( `${ componentPath } : classNameBindings: %o` , classNameBindings ) ;
125133
126- let templatePath = guessTemplatePath ( componentPath ) ;
127- if ( ! fs . existsSync ( templatePath ) ) {
128- throw new SilentError ( `Could not find template at ${ templatePath } ` ) ;
129- }
130- debug ( `${ componentPath } : templatePath: %o` , templatePath ) ;
131-
132- let template = fs . readFileSync ( templatePath , 'utf8' ) ;
133134 let templateAST = templateRecast . parse ( template ) ;
134135
135136 // set `tagName: ''`
You can’t perform that action at this time.
0 commit comments