Questions tagged [grunt]
The grunt tag has no usage guidance.
133
questions
11
votes
3
answers
2k
views
Magento 2 add new theme without changing core files. Grunt
How to extend default Magento 2 Grunt configuration without touching/editing core files like Gruntfile.js and dev/tools/grunt/configs/themes.js?
9
votes
3
answers
2k
views
How does Magento 2 work with CSS grunt-autoprefixer
From looking at a fresh install of Magento 2 (v2.1.8) I see from their Gruntfile.js and package.json files that Magento is using grunt-autoprefixer
This is great, CSS autoprefixers are really useful. ...
9
votes
2
answers
2k
views
Grunt theme source files missing when running Grunt exec
I have a theme that extends the Luma theme. I am trying to get Grunt working to do preprocessing. So far, I don't have any changes/additions in my theme at all. I setup my themes.js as follows:
...
8
votes
1
answer
6k
views
How to enable CSS source Maps for Magento 2
How do you enable CSS source Maps for Magento 2's front-end workflow.
I'm learning M2 and have created a custom theme, called "mytheme", inheriting from the out-of-box luma theme. I'd like to use ...
8
votes
2
answers
931
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 ...
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 ...
7
votes
2
answers
345
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 ...
7
votes
3
answers
3k
views
Magento 2. Less to CSS. Very slow building process. How to improve?
Currently magento2/grunt is very slow in transforming less to css (with a few locales it can take up to a minute to rebuild everything.
Any tips how to improve development speed?
6
votes
5
answers
11k
views
How to configure the theme to use Grunt?
I normally change the file /dev/tools/grunt/configs/themes.js but in the .gitignore we can see a configuration file called /dev/tools/grunt/configs/local-themes.js I'd like to use that file instand a ...
6
votes
4
answers
7k
views
Error after grunt clean
Magento 2
After running: grunt clean and then grunt exec:myTheme I get the following
error: >> [InvalidArgumentException]
There are no commands defined in the "dev:source-theme" namespace.
...
6
votes
1
answer
4k
views
Magento 2 - How to configure Grunt in PhpStorm
I'm trying to configure Grunt in PhpStorm.
I have set for Grunt:
Node interpreter: /usr/bin/node (exists)
Package grunt-cli: [path to Magento 2 dir]
I get the error bellow when I 'Reload tasks' in ...
5
votes
2
answers
7k
views
Magento2: After delete pub/static folder and making deploy, no css files found
I use Magento 2 custom theme and when I made changes to .less file, I wanted to compile files, so I deleted pub/static folder and made deploy: php bin/magento setup:static-content:deploy. After that, ...
5
votes
6
answers
9k
views
How to Configure Magento2 with Gulp instead Grunt
How to configure Magento2 with Gulp instead Grunt.
Anyone have idea ?
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/...
5
votes
1
answer
984
views
How to compile gallery and calendar css with grunt?
I have put gallery.less and calendar.css in web\mage\gallery and web\mage respectively in my custom theme, But they are not compile with grunt.
How can i compile these files with grunt like other ...
5
votes
2
answers
5k
views
Magento 2: How to use Grunt properly for CSS changes
I'm trying to figure out the clusterf-ck which is the Magento 2 front-end theming workflow. And I've read and understood all documentation, read all the blogs about it and are up to date on the latest ...
5
votes
1
answer
1k
views
How to add new theme name to grunt CLI command to run grunt tool in Magento 2?
When we clone new theme from existing parent theme in Magento 2. How we can execute less:newThemName command using grunt CLI ?
As well as how grunt watch will look any changes into newly created ...
5
votes
3
answers
2k
views
Getting an issue working with Grunt in Magento 2
I'm getting this issue after run grunt exec:<theme>, this shows up:
Processed Area: frontend, Locale: en_US, Theme: Ids/prueba, File type: less.
[Magento\Framework\Exception\...
4
votes
2
answers
4k
views
After upgrade to 2m2, grunt fail to run
After upgrade from v2.1.8 to v2.2.2, error is shown when i run Grunt exec
$ grunt exec
Loading "Gruntfile.js" tasks...ERROR
Error: Cannot find file. Alias "themes" not set. Use "...
4
votes
2
answers
3k
views
Difference between static content deploy & grunt exec
What's the difference between following commands (Magento 2)
bin/magento setup:static-content:deploy and grunt exec
When should you use which command?
4
votes
2
answers
2k
views
Grunt watch doesn't watch _theme.less and custom less file
That's my css/source file structure:
https://i.sstatic.net/5tNxJ.png
I made grunt clean, theme exec, theme less, watch.
Watch is responsive to any less file changes accept of _theme.less and local....
4
votes
2
answers
163
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/...
3
votes
3
answers
6k
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 ...
3
votes
2
answers
740
views
Why does Magento 2 use PHP to compile less files?
What I don't understand is that since the .less files are already going to be compiled during development through Grunt, why does Magento 2 still uses oyejorge/less to compile less files through PHP?
...
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 {...
3
votes
1
answer
765
views
Magento 2 - Registering a new Grunt task without editing Gruntfile.js
Following on from this question: Magento 2 add new theme without changing core files. Grunt
The goal is to register a new Grunt task called "development". To do this, grunt.registerTask is needed, ...
3
votes
4
answers
3k
views
Magento 2 + Livereload
I am currently in the middle of setting up a front end workflow for Magento 2, however I am currently unable to get livereload to work. Everything I have read so far on various tutorials and the ...
3
votes
1
answer
2k
views
See less source files in chrome dev tools
How do you see the less file that is generating the style in chrome dev tools?
working in developer mode, in less.js:
var lessOptions = {
options: {
sourceMap: true,
and in config.less....
3
votes
0
answers
158
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 "...
3
votes
0
answers
603
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
1
answer
536
views
Magento Grunt Less Compilation behaves weird
I have a custom theme Mycompany/mytheme including <Magento>/<blank> as parent.
The locale is set to de_DE.
When I execute php bin/magento setup:static-content:deploy de_DE everything ...
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 ...
2
votes
2
answers
9k
views
Fatal error: Unable to find Gruntfile
I have been following a few tutorials to try and get started creating a theme and workflow for Magento 2, and am trying to setup so that I can compile all my LESS files locally, as outlined here.
...
2
votes
2
answers
1k
views
DB error when running grunt exec Magento2
I am running grunt exec:luma and am getting the following errors:
Processed Area: frontend, Locale: en_GB, Theme: Magento/luma, File type: less.
>> [Zend_Db_Adapter_Exception]
>> ...
2
votes
1
answer
2k
views
Cannot create symlink in magento
I installed grunt and run command grunt exec:my theme but it shows me
[Magento\Framework\Exception\FileSystemException]
Cannot create a symlink for "C:/xampp/htdocs/packt/vendor/magento/...
2
votes
1
answer
1k
views
Difference between _extend.less . and _extends.less
While working on a custom theme with blank parent theme , I noticed strange behaviors:
First of all, gulp and grunt give a different output. Mostly these are parts of code in different order (on gulp'...
2
votes
3
answers
5k
views
Static content deploy - Compilation from source
Doing a setup:static-content:deploy never finishes deploying files on a custom theme. Instead gives Compilation from source: frontend/Vendor/theme/en_US/css/email-fonts.less and then stops compiling.
...
2
votes
1
answer
479
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. ...
2
votes
3
answers
3k
views
Error when running grunt exec
I have followed the docs for setting up Less compilation. Running grunt clean and grunt less works without errors, but when I run grunt exec (with or without appending a specific theme name) I get the ...
2
votes
2
answers
7k
views
Grunt less:theme fails @media-common is undefined
I am using a theme that I have created based on a third party theme 'Optimus' and I am trying to use Grunt to compile the LESS.
However, when I run grunt less:theme it fails with the following error:
...
2
votes
1
answer
829
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 ...
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:...
2
votes
1
answer
3k
views
Magento2 LESS extend/override custom theme
I have been going through research and tests for whole day and still found answers do not work for my case or I just do not understand how to properly implement them - therefore post here:
I have ...
2
votes
1
answer
3k
views
jit-grunt: Plugin for the "clean" task not found
After running grunt clean in magento 2.1.3 root folder I get error
If you have installed the plugin already, please setting the static mapping.
See https://github.com/shootaroo/jit-grunt#static-...
2
votes
0
answers
352
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 ...
2
votes
0
answers
237
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="...
2
votes
0
answers
267
views
Grunt - is it possible to watch custome module less files?
I figured out how to watch less files changes inside my custome theme folder using Grunt, but is there any way how to watch less files in custome module?
Let's assume module like so:
app/code/...
2
votes
0
answers
118
views
magento 2 Grunt watch loads old css when changing imported css file
When I use Grunt Watch my less compile does not work as I expect it to be.
When I work directly in my theme. less file all perfectly changes and even with livereload works absolutely great.
But ...
2
votes
0
answers
24
views
How to add new theme name to grunt CLI command to run grunt tool in Magento 2 with CLI commands instead of editing less.js and themes.js file?
I read this , But I wanna add new theme name to grunt CLI command with some CLI commands not editing a less.js and thmemes.js manually.Is there any solution for this
something Like (magento2 add-...
2
votes
1
answer
133
views
local grunt database errors, when I have a vagrant magento2 box
I have a vagrant box (debian) with a Magento2 installation for development. Everything works nice, but changing css/less is very very slow (because everytime I have to remove pub/frontend and var/...