Skip to content

support a directory of definitions when configuring the plugin #18

@thescientist13

Description

@thescientist13

Currently, to tracking custom element definitions in the WCC plugin, you have to provide them individually, e.g.

eleventyConfig.addPlugin(wccPlugin, {
  definitions: [
    new URL('./path/to/my-component.js', import.meta.url),
    new URL('./path/to/my-other-component.js', import.meta.url)
  ]
});

It would be nice if this plugin could detect that a directory is provided, and just glob all the files within that, e.g.

eleventyConfig.addPlugin(wccPlugin, {
  definitions: [
    new URL('./path/to/my/components', import.meta.url),
  ]
});

Will need to make sure this is compatible with cache busting / live reloading in the plugin.


Couple questions / thoughts

  1. Should we just filter on .js / .ts files, or include CSS files too? (probably yes?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions