I got confused with folder structure and the way it imports template. I observed that in productdetails module,there is a folder named templates which have template files of productdetails module with. Ts extension. While the home module doesn't contain such type of folder. Moreover the import paths are also different in both modules. Can someone tell how both of these works ?
Sohan Kumar Dash
11/06/2019, 4:38 PM
@Steve Goldberg@Flo@PabloZ@TheAntman can someone guide me on this topic ?
p
PabloZ
11/06/2019, 4:53 PM
Sorry, i'm not that familiar with 19.2 yet
PabloZ
11/06/2019, 5:02 PM
On first sight, as you point out, the templates folder exists in some modules but no others. That contains not the templates themselves, but the templates type definition. (.d.ts) files which all export exactly the same.
s
Sohan Kumar Dash
11/06/2019, 5:23 PM
@PabloZ thanks. But there is no such type definition file for home module,but still its working, how ?
p
PabloZ
11/06/2019, 5:33 PM
In reality the templates are not injected there. Templates get compiled by a totally different process in the form of the Extension (and Theme) Manager.
PabloZ
11/06/2019, 5:42 PM
Some magic in gulp SC_19.2_Live/gulp/tasks/javascript.js task parses the requires for .tpl files and decides what to do.