This document provides detailed information and advanced tips for using MageForge effectively in your Magento 2 development workflow.
- Alternative aliases for common commands:
frontend:buildformageforge:theme:buildfrontend:watchformageforge:theme:watch
Check bin/magento mageforge for a full list of available commands.
-
System Check: Before starting development, run a system check:
bin/magento mageforge:system:check
-
Enhanced Output: Use the
-voption for more detailed information during builds:bin/magento mageforge:theme:build <theme-code> -v
-
Hot-reloading: Watch mode automatically detects changes and rebuilds:
- For LESS files in standard Magento themes
- For Tailwind-based templates in Hyvä themes
- For custom CSS implementations
For traditional LESS-based Magento themes, MageForge handles:
- LESS compilation via Grunt
- Source map generation
- Minification for production
MageForge automatically detects themes installed via Composer (located in vendor/ directory):
- Build mode: Skips all Grunt/Node.js steps as vendors themes have pre-built assets
- Watch mode: Returns an error as vendor themes are read-only and cannot be modified
This prevents accidental modification attempts and ensures build process stability.
MageForge automatically detects if a Magento Standard theme intentionally omits Node.js/Grunt setup. If none of the following files exist:
package.jsonpackage-lock.jsonGruntfile.jsgrunt-config.json
The builder will skip all Node/Grunt-related steps and only:
- Clean static content (if in developer mode)
- Deploy static content
- Clean cache
This is useful for:
- Themes that use pre-compiled CSS
- Minimal themes without custom LESS
- Simple theme inheritance without asset compilation
Note: Watch mode requires Node.js/Grunt setup and will return an error if these files are missing.
MageForge streamlines Hyvä theme development with:
- Automatic TailwindCSS compilation
- PurgeCSS optimization
- Component scanning
For custom Tailwind setups (non-Hyvä), MageForge supports:
- Custom Tailwind configuration
- PostCSS processing
- Custom directory structures
Avanta is a B2B theme built on top of Hyvä. Because MageForge detects Hyvä themes via etc/hyva-themes.json, Avanta themes are automatically recognised and built using the Hyvä builder — no additional configuration required.
bin/magento mageforge:theme:build Vendor/avantaAll Hyvä builder features apply: TailwindCSS compilation, PurgeCSS optimisation, and watch mode.
mageforge:theme:build accepts multiple theme codes, so you can build several themes without re-running the command:
bin/magento mageforge:theme:build Vendor/theme1 Vendor/theme2You can also pass a vendor prefix to build all themes from that vendor at once:
bin/magento mageforge:theme:build HyvaInstead of triggering full rebuilds manually, use watch mode. It detects file changes and recompiles only what is needed, keeping feedback loops short:
bin/magento mageforge:theme:watch Vendor/themeAdd -v to see each step's timing and output, which helps identify bottlenecks:
bin/magento mageforge:theme:build Vendor/theme -vThemes installed via Composer (in the vendor/ directory) are detected automatically. MageForge skips all Node.js and Grunt steps for them, as their assets are pre-built. Building a vendor theme only runs static content deployment and cache clean.
Themes that omit package.json / Gruntfile.js also skip the Node.js pipeline entirely, resulting in significantly faster builds (static content deployment and cache clean only).
Common issues and solutions:
-
Build Failures:
- Ensure Node.js is installed and available
- Check for syntax errors in LESS or CSS files
- Verify Tailwind configuration is valid
-
Watch Mode Issues:
- Check file permissions
- Ensure no conflicting processes are running
-
Integration Problems:
- Clear Magento cache after theme builds
- Verify theme registration in Magento
For more help, open an issue on GitHub Issues or start a discussion on GitHub Discussions.