Questions tagged [grunt]
The grunt tag has no usage guidance.
133 questions
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?
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 ...
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 ...
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 ...
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.
...
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. ...
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":[],"...
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/...
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 ...
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....
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 ...
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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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>/<...
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/...
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 ...
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\...
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 ...
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 ...
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&...
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" (...
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.
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 ...
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 ...
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="...
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/...
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:...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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
...
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/...
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 "...
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 ...
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\...
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 ...
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:...
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 {...
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 ...
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!
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 ...