Skip to main content

Questions tagged [grunt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Watcher for phtml and JS files also

That will be fine to make able grunt livereload watcher for phtml and JS files also. Any ideas?
Max.A's user avatar
  • 117
0 votes
0 answers
75 views

Grunt task for the tailwind in magento 2 frontend

We are working on the custom theme with the tailwindCSS. Normal Magento flow is taking a long time to reflect the changes on the browser. My question is there any configuration or way to use Grunt to ...
Naveen Raj Kumar's user avatar
0 votes
1 answer
66 views

How to use Multiple custom .less files in Magento 2 using Grunt.js

We are developing a custom theme for our Front Store view so we need to use multiple .less files in web/css/source. with the help of Grunt.js, the development makes us faster than manually generating ...
Naveen Raj Kumar's user avatar
1 vote
1 answer
56 views

Change livereload host

The default livereload host is 127.0.0.1, but I have the access problems to access the this host directly in WSL2. Need to change it to http://localhost:35729/livereload.js Found the solution to ...
Max.A's user avatar
  • 117
0 votes
2 answers
1k views

Magento 2 : How Can I Add custom.less File For Only Specific Page?

how can i add custom.less file for any specific page in child theme? means don't need genrate inside my custom css code in style-l.css or style-m.css and i have already 2 methods used. Method 1. ...
Gaurav's user avatar
  • 29
2 votes
1 answer
501 views

Magento 2 - Can't compile new theme, which inherits from luma

I created a new minimalistic theme in a fresh Magento 2.4.2 The theme inherits from Magento/luma Example: app/design/frontend/company/foo/registration.php: <?php /** * Copyright © Magento, Inc. ...
Black's user avatar
  • 3,431
0 votes
1 answer
677 views

CSS Source Maps are empty after grunt refresh

On Magento 2.4.1, Developer Mode and SSR after running grunt clean grunt exec grunt less # OR grunt refresh Generated Source Maps looks like this {"version":3,"sources":[],"...
Ilja Polanskis's user avatar
1 vote
0 answers
19 views

Different frontend CSS results (Grunt vs deploy:mode:set production)

I have a weird issue where the frontend results of a grunt compile are different compared to a compilation after deploy:mode:set production. UI elements are different. Why is that? How can I debug/...
Akif's user avatar
  • 1,551
0 votes
2 answers
1k views

Magento 2.4.1. Grunt exec error

I have tried this on a clean install of magento 2.4.1 I then went to a magento 2.3.6 ran grunt exec and grunt less both worked After upgrading the 2.3.6 to 2.4.1 the grunt exec then failed with the ...
Phes's user avatar
  • 86
0 votes
0 answers
200 views

Magento 2.4 alternatives to Livereload Chrome extension for live styling via Grunt?

Magento officially recommends Livereload for "watching" changes made via Grunt and updating the browser in real-time without reloading the page for each change here: https://devdocs.magento....
Louis B.'s user avatar
  • 1,122
1 vote
1 answer
1k views

Magento 2 - Could not load content for ... (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)

I am using grunt with livereload to compile my less files. Grunt also generates source maps so that I can directly see in my browser, in which LESS files css code is located. But often when I click to ...
Black's user avatar
  • 3,431
0 votes
1 answer
847 views

Magento 2 - Can't compile theme in production mode anymore | Unable to retrieve deployment version of static files from the file system

I get this error when trying to execute grunt refresh or grunt exec:all. [2020-08-17 05:25:31] report.CRITICAL: Can not load static content version. [] [] [2020-08-17 05:25:31] report.ERROR: Unable to ...
Black's user avatar
  • 3,431
3 votes
1 answer
374 views

Magento2 eslint entire custom code

I've noticed Magento2 has Javascript Coding Standards, in which they reference an eslint config file. Suppose I have an M2 project I'm developing with a large group of folks and I'd like the team to ...
quickshiftin's user avatar
  • 1,436
0 votes
0 answers
2k views

How to install grunt within docker container?

I finally was able to finish installing M2 enterprise cloud on docker for local dev, and the one final step is to install grunt so I can do some frontend work. I've been trying to wrap my head around ...
Terence Patane-Ronan's user avatar
0 votes
1 answer
319 views

Static content generation: problems with grunt exec and grunt less

I'm working on a Magento 2.3.4 website that has a custom theme, developed by a different party. I need to modify some .less files and I noticed something strange. grunt exec, that should publish the ...
Peter Karsai's user avatar
1 vote
1 answer
219 views

Is it absolutely REQUIRED that you install grunt globally for it to work out of the box with Magento 2?

Documentation at https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/tools/using_grunt.html states to install grunt using the -g (global) command, which requires elevated privileges. ...
grok_in_full's user avatar
2 votes
1 answer
865 views

locally installed grunt, "grunt exec:blank" fails with "/bin/sh: grunt: command not found"

I am hosted at Nexcess and tried to implement Grunt to assist with LESS development. I followed the Magento 2 docs for installing grunt. NodeJS 10.10.0 is installed. The first deviation from the ...
grok_in_full's user avatar
0 votes
1 answer
1k views

Unable to get Grunt less task working on Custom Magento theme

Good morning, I'm pretty new to Magento 2 and I'm currently in the process of trying to get my first custom M2 theme up and running. I have managed to create my new theme but running into trouble ...
steffcarrington's user avatar
0 votes
1 answer
73 views

Magento2 how to define theme in my themes.js

What is the correct way to define theme in theme.js dev/tools/grunt/configs/themes.js My theme in app/design is Hose/Fit <theme>: { area: '<area>', name: '<Vendor>/<...
Arjun's user avatar
  • 3,606
0 votes
1 answer
193 views

Magento2 grunt error

> npm install -D load-grunt-config npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen) npm ERR! Linux 4.15.0-52-generic npm ERR! argv "/usr/bin/...
Arjun's user avatar
  • 3,606
0 votes
1 answer
2k views

Magento 2 LESS - Unable to resolve the source file for ..., after deleting source file

I deleted a less file which I don't need anymore. I also removed the entry from default_head_blocks.xml so that it does not load anymore. I searched my whole theme for main.css and removed all ...
Black's user avatar
  • 3,431
1 vote
1 answer
706 views

Magento 2 - Grunt watch not detecting changes of _extend.less

I have these files: THEME = app\design\frontend\company\base THEME\web\css\source\lib\extend\variables\_typography.less THEME\web\css\source\lib\extend\variables\_colors.less THEME\web\css\source\...
Black's user avatar
  • 3,431
0 votes
1 answer
977 views

Magento 2 - LiveReload is connected, but changes are only visible after manual reload

I try to use grunt watch in combination with livereload. But there is almost no documentation on the topic. I installed livereload like this: npm install -g livereload Then I added the following ...
Black's user avatar
  • 3,431
2 votes
4 answers
3k views

Magento 2 - css source maps not working

I created a new theme which extends from magento luma. I try to develope with less instead of css. I need to enable CSS Source maps, so that I can debug my less, it helps to see in which less files ...
Black's user avatar
  • 3,431
1 vote
1 answer
774 views

i cant set up grunt due an error

i want to create luma based theme and set up grunt for it. path to .less files: frontend///web/css/source/style-l.less im getting an error: unable to resolve the source file for 'frontend/<vendor&...
cffbl's user avatar
  • 11
0 votes
1 answer
502 views

Magento 2 local Docker - running less:theme fails for file not found, but file is present

I finally have a local docker setup for my Magento 2 development set up. It works fine everywhere, except for when I run grunt less:MyTheme. When I do that I get this error Running "less:MyTheme" (...
Asitis's user avatar
  • 1,257
0 votes
1 answer
172 views

Add grunt-notify to M2 Grunt config

How to add grunt-notify module to Magento 2 Grunt config. Reference: https://github.com/dylang/grunt-notify Thanks.
Max.A's user avatar
  • 117
0 votes
2 answers
53 views

Magento 2.3 grunt compile

My simple question is that, Do i need to compile less with grunt in magento? My theme is working fine. However i am not sure that i need to compile less with grunt or not. Is there any impact on ...
Ashar Riaz's user avatar
  • 1,035
7 votes
2 answers
347 views

Different less compilation results between grunt and server side compilation

I got the following theme inheritance setup: Vendor/Retail inherits from Vendor/Default which inherits from Magento/blank When compiling the styles with grunt I get no issues. When compiling with ...
Michael Thessel's user avatar
2 votes
0 answers
240 views

How magento decides order of all _module.less file imported through @magento_import directive?

I am trying to add module specific less file named _module.less inside my custom module Mynamespace_Mymodule in M2. For that I have created module.xml file with below sequence. <module name="...
Shashank Bhatt's user avatar
4 votes
2 answers
166 views

Create less file for custom Theme

How to create new *.less file in Magento 2.3 project ? Here is my existing Theme: Here is my existing less file that DOES NOT work: Nothing is work here: My question is how to add custom less code/...
Yusuf Ibrahim's user avatar
2 votes
2 answers
36 views

Page Styling (css) does not appear in the new Theme implementation (descendant of Luma Theme)

I just created empty theme which is descendant of Luma theme. but unfortunately the styling is not appear: theme.xml <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
Yusuf Ibrahim's user avatar
1 vote
6 answers
950 views

run grunt in mangeto 2

Already follow from this dev document this 1.npm install -g grunt-cli 2.Rename 3 files - package.json.sample into package.json - Gruntfile.js.sample into Gruntfile.js - grunt-config.json.sample ...
Keep in touch's user avatar
3 votes
3 answers
7k views

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

We are running Magento 2 in version 2.3.1, but the error occurred in version 2.3.0 also. The situation is the following: we've created a custom theme which has Magento/luma theme as parent. according ...
TurnJoke's user avatar
1 vote
1 answer
134 views

Grunt workflow, problems with watch task and reloading

I've been trying to get the "grunt watch" task running combined with livereload but unfortunately I'm not able to get a working solution. I've read the magento devdocs but running a combination of the ...
John Plusje's user avatar
0 votes
0 answers
197 views

Magento 2.3 admin not working after grunt setup

I have a big problem.I setup grunt configuration for magento 2.3 as I used to setup for magento 2.2 and renamed below files grunt-config.json.sample, package.json.sample and gruntfile.js.sample by ...
Shashank Bhatt's user avatar
8 votes
2 answers
952 views

Grunt compile of LESS fails with Error compiling lib/web/css/docs/source/docs.less

I'm hoping to get some advice. I pulled a project that I haven't touched in some time and in developer mode I ran 'grunt exec' followed by 'grunt less' and once running 'grunt less' I receive the ...
Rob's user avatar
  • 534
1 vote
2 answers
371 views

What is Grunt in Magento2 and Why use?

What is Grunt in Magento2? Why use grunt. I want to know detail about Grunt. When we can use Grunt.
Chandra Kumar's user avatar
1 vote
2 answers
41 views

mess up ownerships after cli action

so I am running a magento 2.2.4 in development and one in production, the dev is ok and I can do all, the production is an exact copy of it on apache 2.4 and Ubuntu 16.04, every time I use any kind of ...
Luca Cagnassi's user avatar
1 vote
1 answer
527 views

Magento2 grunt issue occurs when running?

I am using Magento2 version CE-2.2.4 i installed npm,grunt on fresh project but when i am running command grunt exec:theme then it create an error Loading "Gruntfile.js" tasks...ERROR ...
Magento Dev's user avatar
  • 1,264
5 votes
2 answers
258 views

Magento 2.2.5 Css is not generating

I have one project in Magento 2.2.5 and in that the CSS is stopped generating I have run all grunt command and in that it show below error when i run grunt exec pub/static/frontend/Magento/luma/en_US/...
Kajal Solanki's user avatar
3 votes
0 answers
159 views

Grunt (Magento 2) - Why do I have to force my commands?

I've just installed grunt for the first time however I cannot run any commands in cmd wihtout using --force. My error is: C:\wamp64\www\New_Mage2>grunt watch jit-grunt: Plugin for the "...
Greg's user avatar
  • 399
1 vote
1 answer
3k views

Magento2: Missing commands on build server

I try to make a Magento2 Pipeline Deployment and running in a awkward error. But first a few words to the deployment: I use a docker container with installed php and nodejs. I copy in the container ...
bambamboole's user avatar
0 votes
1 answer
782 views

Import new custom less files after grunt configuration

I am using grunt tool for magento server-side less preprocessing. I have created _extend.less file following directory structure for my custom less compilation app\design\frontend\Vendorname\...
Shashank Bhatt's user avatar
0 votes
1 answer
138 views

How to declare and use custom configuration file for less compilation with grunt?

According to devdocs which is located at https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/tools/using_grunt.html#grunt_config Now I simply can't understand what it is trying to say.Can ...
Shashank Bhatt's user avatar
3 votes
0 answers
606 views

Plugins less with Magento Theme

Good morning, I would like to know if somebody has worked with less plugins in Magento Environment? Indeed, I met no difficulties with grunt tools, but when Magento compile all files (through setup:...
Ilan Parmentier's user avatar
3 votes
4 answers
3k views

Grunt, .less, and Live Reload - Can't get them working

Good afternoon, I am having a devil of a time getting my front-end flow working. I have grunt CLI working, along with theme.js setup properly (see images below). Still, when I make changes within my {...
AdamJSim's user avatar
  • 113
1 vote
1 answer
1k views

How to install node_modules in server for grunt configuation

As a designer I am totally new to magento 2 file structure and preprocessing. As far as my understanding is correct, magento uses less files and uses gruntfile.js for preprocessing so that via ...
Shashank Bhatt's user avatar
1 vote
1 answer
202 views

Magento2 Keeping CSS changes after redeployment [duplicate]

Hi I am new to Magento 2, I was wondering what methods people are using to keep CSS changes after they deploy static content as CSS changes are overwritten every time. Thanks!
Damion's user avatar
  • 11
7 votes
2 answers
6k views

LiveReload configuration via Grunt

Edit : about the possible duplicate ! I would like to mention that this answer does not answer my question, if someone sees that it is the same thing, I invite him to answer me instead of saying that ...
PЯINCƎ's user avatar
  • 11.7k