root
Root path where to look for folders containing component files.
folders
Folder paths where to look for component files. Relative to The paths you defined will be added to the default folders.
root.If you keep your components in a different folder, you can add it here:config.js
fileExtension
Define the file extension(s) that component files must use.To define multiple file extensions, use an array:Any other files will be ignored and not be made available as components.
config.js
tagPrefix
Prefix string to use for component tags.If you prefer to write
<a-button> instead of <x-button>, do this:config.js
tag
You may alternatively reference any component using this tag name and passing in the component file path in the Set it to
src prop.By default, this ensures backwards compatibility with the old components system so you can continue to use syntax like <component src="button.html" /> in your templates.For example, if you prefer to write <module src="button.html" />, do this:config.js
false to disable this feature and only use x- tags.attribute
You may define a custom attribute name to use for the You can now use
tag.config.js
<component href="button.html" /> in your templates.yield
Name of the tag that will be replaced with the content that is passed to the component.If you want to change it to be You’d then define a component like this:
content as in previous versions of Maizzle, do this:config.js
components/button.html
slot
Name for the You could then use You’d fill Result:
slot tag.For example, maybe you want to change this to be provide:config.js
provide instead of slot when defining a component:components/footer.html
provide as usual:emails/example.html
build_production/example.html
fill
Name for the Given the previous example, you’d now use
fill tag.For example, maybe you want to change this to be inject:config.js
inject instead of fill when defining a component:emails/example.html
slotSeparator
String to use as a separator between the You’d then use
slot tag and its name.For example, changing it to @:config.js
<slot@footer-logo /> and <fill@footer-logo>:emails/example.html
push
Name for the <push> tag.
stack
Name for the <stack> tag.
propsScriptAttribute
Name of the props attribute to use in the … you’d then use
<script> tag of a component.If you change it to locals:config.js
locals instead of props when defining the script in a component:components/button.html
propsContext
Name of the object that will be used to store the props of a component.For example, if you change it to … you’d then use
data like this:config.js
data instead of props when defining the props of a component:components/button.html
propsAttribute
Name of the attribute that will be used to pass props to a component as JSON.Set to You’d then use
locals by default, for backwards compatibility with the old components system.Again, let’s change it to data:config.js
data instead of locals when passing props as JSON to a component:emails/example.html
propsSlot
String value used to retrieve the props passed to slot via
$slots.slotName.props.For example, if you change it to data and have a component with a header slot, you’d be able to access the props passed to the slot via $slots.header.data.parserOptions
Object to configure the underlying
posthtml-parser library.By default, it enables support for self-closing component tags.expressions
Object to configure how expressions are handled in components.Maizzle passes your config variables and the contents of your
build.expressions object to it, so that you have them all available inside your components.plugins
Array or object of PostHTML plugins to apply to each parsed component.When used as an array, plugins will be applied to each component after expressions are parsed inside of it:You may use the
config.js
before and after keys to apply plugins before or after expressions are parsed:config.js
attrsParserRules
Extra rules for the PostHTML plugin that is used by components to parse attributes.
strict
In
strict mode, an error will be thrown if a component cannot be rendered.utilities
Utility methods to be passed to
<script props>.By default you can use mergeWith and template from lodash.elementAttributes
Define additional attributes that should be preserved for specific HTML elements.It’s an object with the following structure:For example, say you have an attribute called
tracking-id that you only use on <div> elements. By default, it would be stripped out in a component, because it’s not a standard HTML attribute.But you can add it to the ‘valid’ attributes list for <div> elements like this:config.js
This is only useful to control which elements can use what attributes. If you’d like to have all elements use an non-standard attribute, use
safelistAttributes instead.safelistAttributes
Array of attributes that should be preserved in components (on all elements).You can use a
* wildcard to match the rest of the string:config.js
blacklistAttributes
Array of attributes that should be removed from components (on all elements).
config.js