This document provides detailed information and advanced tips for using MageForge effectively in your Magento 2 development workflow.
-
Use shortcodes for faster command execution:
m:t:binstead ofmageforge:theme:buildm:t:winstead ofmageforge:theme:watchm:s:cfor system check
-
Alternative aliases for common commands:
frontend:buildformageforge:theme:buildfrontend:watchformageforge:theme:watch
-
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
MageForge has special support for Avanta B2B themes with:
- B2B-specific component scanning
- Special optimization for B2B module templates
- Build specific theme components instead of entire themes for faster development
- Use the production flag for minified, optimized output when ready for deployment
- Consider selective watching for large themes to improve performance
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.