The steps I usually follow in my development environment is as follows:
- Copy a html design file for an existing display template (for example the “Item_TwoLines.html” for CSWP item display templates)
- Save it to the same location, but with a different name (for example “Item_MyTemplate.html”)
- Delete the two files from the display template library in SharePoint
- Create an empty module in your SharePoint project in Visual Studio and give it a name and an Url as shown below
Add an element for your new template as shown below
- Remember to set “Level” to “published” and “ReplaceContent” to “true” in order for simpler solution upgrade
- Deploy the template and test it!