LWC Templates In Subfolders

Issue #1431 new
Kristoffer Greene created an issue

Template files within sub-folders of lightning web component bundles do not currently get code completion or recognize directives, components, etc. The bundle still deploys and works fine otherwise. This would only come into play when using render().

How to reproduce:

  1. Create lightning web component.
  2. Create sub-folder (say, a templates folder) within LWC bundle.
  3. Create .html file within sub-folder.
  4. Add <lightning-button label="Repro"></lightning-button> to the template such that the template reads as:
    <template> <lightning-button label="Repro"></lightning-button> </template>
  5. Observe that directives are also not recognized.

The bundle will still deploy without issue and the new template can still be swapped to via the render method and importing the template from the sub-folder. e.g. import someTemplate from './templates/someTemplate.html';

Comments (2)

  1. Log in to comment