Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple components in single file #111

Open
vinoth-sarsha opened this issue Feb 17, 2022 · 0 comments
Open

Multiple components in single file #111

vinoth-sarsha opened this issue Feb 17, 2022 · 0 comments

Comments

@vinoth-sarsha
Copy link

It more of a suggestion than a issue. We have a scenario where we have grouped multiple web components in a single file. But while specifying the respective file url in the elementConfig, its working only if we add multiple entries for the each component with the same file url.

const plugins: LazyElementModuleOptions = {
  elementConfigs:[
    { tag: component1', url: 'assets/component-file.js'},
    { tag: 'component2', url: 'assets/component-file.js'},
   { tag: 'component3', url: 'assets/component-file.js'},
  ]
}

If a solution exists for the above, please let me know.

If solution doesn't exists, my suggestions would be:

  1. Making the tag as a pattern match
    { tag: 'component-*', url: 'assets/component-file.js'}
  2. Match the element also with a attribute instead of the element-tag
    <component-one tag-attr *axLazyElement></component-one>
    { attribute-tag: 'tag-attr', url: 'assets/component-file.js'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant