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

Add support for an array of globs in getComponentsMap #123

Closed
zachleat opened this issue Mar 2, 2023 · 1 comment
Closed

Add support for an array of globs in getComponentsMap #123

zachleat opened this issue Mar 2, 2023 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@zachleat
Copy link
Member

zachleat commented Mar 2, 2023

Right now when you pass an array to getComponentsMap we assume that you’re passing in a list of file names. You may want some of these to be globs.

Practically speaking this is used by the Eleventy WebC plugin when we pass in the components prop, so this would unlock something like this, too:

const pluginWebc = require("@11ty/eleventy-plugin-webc");

module.exports = function(eleventyConfig) {
	eleventyConfig.addPlugin(pluginWebc, {
		components: [
			"_components/**/*.webc",
			"_includes/**/*.webc"
		],
	});
};
@zachleat zachleat added the enhancement New feature or request label Mar 2, 2023
@zachleat
Copy link
Member Author

zachleat commented Mar 2, 2023

Also gonna sneak in aliasing here too, so you can do this:

const pluginWebc = require("@11ty/eleventy-plugin-webc");

module.exports = function(eleventyConfig) {
	eleventyConfig.addPlugin(pluginWebc, {
		components: [
			"_components/**/*.webc",
			"npm:@11ty/is-land/*.webc"
		],
	});
};

@zachleat zachleat added this to the Next version milestone Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant