Node.js
Maizzle 5 requires Node.js v18.20 or higher. Check your current Node.js version:Maizzle is tested on Node.js 18, 20, and 22.
Update @maizzle/cli
Users with@maizzle/cli installed globally need to upgrade it to v2.x in order to continue using it in Maizzle 5 projects:
npm run dev from package.json.
Update package.json
The@maizzle/framework package is now a module, so you need to update your package.json file to reflect this change.
package.json
Upgrade dependencies
It’s probably best that you do a clean install:- remove
node_modulesdirectory - remove
package-lock.jsonand/oryarn.lock
If using yarn, note that it might have cached your dependencies.
latest version of Maizzle:
Update your HTML
yield
The<content /> tag has been replaced with <yield />.
Make sure to update it in your Layouts and Components:
layouts/main.html
style
Tailwind CSS can now be used as expected, with@tailwind directives in any <style> tag, instead of the old <style>{{{ page.css }}}</style>.
layouts/main.html
Update tailwind.config.js
We createdtailwindcss-preset-email to make it easier to use Tailwind CSS for styling HTML emails - it outputs more email-friendly CSS and includes some useful plugins.
Using it will now greatly simplify your tailwind.config.js file, this is all you need:
tailwind.config.js
tailwind.config.js - Maizzle will not automatically scan any paths for files containing Tailwind classes to generate.
Update config.js
The Maizzle config has been reimagined, so naturally there are a few breaking changes.ESM export
The config file is now an ESM module, which means you can useimport and cool stuff like top-level await.
It also means you need to make this change:
config.js
module.exports you must use the .cjs extension:
build
Thebuild key, which is where you define what emails to build and where to output them, has changed considerably.
This is how the build key looks in Maizzle 5:
config.js
components
Thecomponents key has been moved outside build, to the root of the config file:
config.js
events
Events have been moved to the root of the config file:config.js
extraAttributes
This key has been moved tocss.attributes.add:
config.js
layouts
Thelayouts key is no longer used, you can safely remove it.
inlineCSS
Configuration for CSS inlining has been moved under thecss.inline key:
config.js
outlook
Configuring the custom tag for Outlook conditionals is done through the sameoutlook key, but at the root of the config file instead of inside the posthtml key:
config.js
fetch
Thefetch key has been moved to the root of the config file:
config.js
postcss
PostCSS may now be configured under the rootpostcss key:
config.js
removeAttributes
This Transformer has been moved tocss.attributes.remove:
config.js
removeUnusedCSS
Configuration for this Transformer has been moved tocss.purge:
config.js
shorthandCSS
The shorthand CSS Transformer config has been moved tocss.shorthand:
config.js
safeClassNames
ThesafeClassNames option has been renamed and moved to css.safe:
config.js
server
Browsersync has been replaced with a custom dev server, powered by Express.js and WebSockets withmorphdom for an HMR-like local development experience.
We call this Hot Markup Replacement™.
This new dev server is much faster and provides a nicer experience, but you’ll need to update your config.js if you want to configure it:
config.js
sixHex
This Transformer config has been moved tocss.sixHex:
config.js
tailwind
Thetailwind key in config.js has been deprecated, you can safely remove it.
You may now simply use @config in your <style> tags or files included with <link>, to specify a custom Tailwind CSS config file to use:
layouts/main.html
css/tailwind.css
<link> tag or with an @import statement:
css.tailwind:
config.js
templates
Thetemplates key has been deprecated, see build above for how to define Template and other assets sources.
applyTransformers
This has been renamed touseTransformers:
config.js