20 votes
Accepted

LiveReload configuration via Grunt

It's been two days since the post is open and no one has found the answer to my question, and working hard on this topic I finally found the solution. So I decided to publish the complete solution, ...
PЯINCƎ's user avatar
  • 11.7k
15 votes

Magento 2 - css source maps not working

In magento 2.4.4 I had same problem. I fixed it by downgrading to "grunt-contrib-less": "1.4.1" in package.json and running npm install again.
Vince Verhoeven's user avatar
12 votes

Magento2: After delete pub/static folder and making deploy, no css files found

You need to run grunt exec and then grunt less.
Aaron's user avatar
  • 259
10 votes

Magento 2 add new theme without changing core files. Grunt

Creating new theme for Magento 2 could be a challenge even having experience with Magento before. Decent developers would not change core Magento files, but create "wrappers" instead, so in future ...
Jev Mokrousov's user avatar
9 votes
Accepted

Error after grunt clean

I have the same issue and I solved it by removing the 2 folders below : /var/di /var/generation
user1171440's user avatar
9 votes
Accepted

How to configure the theme to use Grunt?

Set up Grunt Environment When the installation is finished, the next step is to setup the Grunt environment. All described steps are covered in the official Magento 2 documentation, although there it’...
Prakash Patel's user avatar
8 votes
Accepted

After upgrade to 2m2, grunt fail to run

Because in M2.2 there is a new grunt config file : grunt-config.json http://devdocs.magento.com/guides/v2.2/frontend-dev-guide/tools/using_grunt.html so we have to install it again, and update grunt-...
leo's user avatar
  • 1,236
7 votes
Accepted

Run Grunt deploy task -> Fatal error: Class 'Locale' not found

You php do not have intl extension. You can verify it by run php -i. In many cases this problem appear when you have different php version/configurations for apache and cli. For example if use ...
KAndy's user avatar
  • 20.8k
7 votes
Accepted

Magento 2 - How to configure Grunt in PhpStorm

Magento2 Grunt Documentation Install NodeJs in your pc Use comand line: Install Grunt CLI tool globally npm install -g grunt-cli * Install the node.js project dependency npm install * Remove ...
St3phan's user avatar
  • 2,907
7 votes

Magento 2 Theme Development - grunt watch not detecting changes of custom LESS file

Please open the file: dev\tools\grunt\configs\local-themes.js module.exports = { company_base: { area: 'frontend', name: 'Company/Base', // <--- name must match the folder ...
Black's user avatar
  • 3,330
6 votes
Accepted

Fatal error: Unable to find Gruntfile

You always need a Gruntfile.js to run grunt (as far as I'm aware) so if you don't have this file in your root directory I'm fairly certain this is the cause of your problem. I think the only purpose ...
Ben Crook's user avatar
  • 15.7k
6 votes
Accepted

Why does Magento 2 use PHP to compile less files?

In short, it's a question of extendability. As you may know, you are able to use .less files inside of custom modules. Let's imagine a situation when a store using some custom theme and in your ...
Yaroslav Rogoza's user avatar
6 votes

Magento 2.2.5 Css is not generating

Check the grunt versions into package.json this solves the issue "devDependencies": { "glob": "~7.1.1", "grunt": "^1.0.2", "grunt-autoprefixer": "~3.0.4", "grunt-banner": "~0.6.0", ...
Kajal Solanki's user avatar
5 votes
Accepted

How to compile gallery and calendar css with grunt?

please follow below step to compile "gallery.less" create "mage" folder under your theme copy "gallery" folder from "root/lib/web/mage/gallery/" and put under "app/design/frontend/vendor(packagename)...
Satish Rana's user avatar
  • 1,491
5 votes

How to configure the theme to use Grunt?

You can copy file /dev/tools/grunt/configs/themes.js to /dev/tools/grunt/configs/local-themes.js Then edit Gruntfile.js file in your magento root folder : At line 19, change dev/tools/grunt/configs/...
Céline Garel's user avatar
5 votes

How does Magento 2 work with CSS grunt-autoprefixer

Customize dev/tools/grunt/configs/autoprefixer.json and run grunt autoprefixer. You need to setup it manually in you the deployment pipeline, b/c there is no way to run Grunt tasks from Magento.
igloczek's user avatar
  • 1,252
5 votes

How does Magento 2 work with CSS grunt-autoprefixer

Please perform above changes, I hope it will work out well. package.json { "name": "Project", "author": "Vendor", "description": "Node modules dependencies for local development", "version": ...
gelanivishal's user avatar
  • 1,336
5 votes

Cannot create symlink in magento

Please open the cmd window as administrator. Right click on CMD then "Run as Administrator" then run your grunt commands and it will work !
PЯINCƎ's user avatar
  • 11.7k
4 votes
Accepted

DB error when running grunt exec Magento2

grunt exec is esentially a shorthand for clearing the folders var/view_preprocessed, var/generation, var/log/system.log and pub/static and running php bin/magento dev:source-theme:deploy --type=less ...
Claudiu Creanga's user avatar
4 votes
Accepted

Difference between static content deploy & grunt exec

As far as I know, Grunt is a Node Js package, so at the first time to make the Grunt commands can work, we need to install Node Js. For instance, when run the command: grunt clean:<theme>, ...
Khoa TruongDinh's user avatar
4 votes
Accepted

Different less compilation results between grunt and server side compilation

I finally figured it out. In case someone else runs into the same problem I'll post the solution. The server side asset compilation doesn't support double quotes in the .media-width() mixin arguments. ...
Michael Thessel's user avatar
3 votes
Accepted

Magento 2: How to use Grunt properly for CSS changes

I finally figured it out as seen in this topic. At the time I posted this question my main feat was the error (".. no source files were found"). This was solved by running setup:static-content:deploy ...
Asitis's user avatar
  • 1,247
3 votes
Accepted

What are magento2 blacklists?

Before merge new PR with bugs fixes and features the Magento 2 core teams run builds with different types of tests. This blacklist.txt is used by the Magento static tests. Some js files, phtml views, ...
joni jones's user avatar
  • 2,549
3 votes
Accepted

Magento 2 grunt watch is not pre-processing LESS for main locale

I found the answer. I had added my theme to the dev/tools/grunt/configs/themes.js file, but had specified en_GB instead of en_IE. To put it another way, the locale inside dev/tools/grunt/configs/...
Aaron Pollock's user avatar
3 votes

How to Configure Magento2 with Gulp instead Grunt

I personally use this simple gulpfile.js to process my css to the pub folders. // Load gulp and plug-ins var gulp = require('gulp'), jshint = require('gulp-jshint'), less = ...
Kay Int Veen's user avatar
  • 1,503
3 votes

grunt exec command not working in magento2 - Unable to find local grunt

grunt exec is esentially a shorthand for clearing the folders var/view_preprocessed, var/generation, var/log/system.log and pub/static and running php bin/magento dev:source-theme:deploy --type=less -...
Claudiu Creanga's user avatar
3 votes

Static content deploy - Compilation from source

A little late to the party but what if you rename the source frontend/Vendor/theme/web/css/source/email-fonts.less file to _email-fonts.less (notice the underscore) I was just getting the same ...
sdaugherty's user avatar
  • 1,229
3 votes

Can't get Grunt working for Magento 2

It appears to be working. grunt clean will clean (and remove) the old css/less files and grunt compile will compile the css to less and then grunt watch will run in the background - updating your ...
Rebel's user avatar
  • 305
3 votes
Accepted

How to enable CSS source Maps for Magento 2

ok so I cam back to this and I got it working, the issue was simply that I had the Front-end development workflow set to Client Side compilation, which was overriding the CSS files created by Grunt ...
Holly's user avatar
  • 4,873
3 votes

Grunt watch doesn't watch _theme.less and custom less file

I looked into it … AND! finally the solution is too easy: The Client Side and Grunt Compilation of *.less files REQUIRES the @import directive to contain the file extension: use @import '_test....
Rico Neitzel's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible