Questions tagged [grunt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
11
votes
3answers
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
3answers
1k 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. ...
8
votes
1answer
4k 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
2answers
664 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 ...
8
votes
1answer
1k 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: ...
7
votes
1answer
5k 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
3answers
2k 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
5answers
9k 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
3answers
5k 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
1answer
3k 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
2answers
6k 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
6answers
8k views

How to Configure Magento2 with Gulp instead Grunt

How to configure Magento2 with Gulp instead Grunt. Anyone have idea ?
5
votes
2answers
213 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
2answers
4k 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
1answer
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
3answers
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\...
5
votes
2answers
184 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 ...
4
votes
1answer
663 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 ...
4
votes
2answers
108 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/...
4
votes
2answers
2k views

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

That's my css/source file structure: https://i.stack.imgur.com/5tNxJ.png I made grunt clean, theme exec, theme less, watch. Watch is responsive to any less file changes accept of _theme.less and ...
3
votes
2answers
3k 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 "...
3
votes
2answers
623 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
2answers
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?
3
votes
4answers
2k 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
2answers
4k 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: ...
3
votes
1answer
628 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
4answers
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
1answer
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
0answers
298 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
1answer
500 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
2answers
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
1answer
1k 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
3answers
3k 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 ...
2
votes
3answers
4k 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
1answer
668 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
2answers
27 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
1answer
2k 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
0answers
118 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 "...
2
votes
0answers
182 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
0answers
106 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
0answers
22 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
1answer
129 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/...
2
votes
1answer
566 views

SyntaxError: Cannot read property 'numerator' of undefined in pub\static\fron \package\theme\en_US\css\source\lib\_responsive.less

SyntaxError: Cannot read property 'numerator' of undefined in pub\static\frontend\package\theme\en_US\css\source\lib_responsive.less on line 44, column 9: 43 @media only screen and (max-width: ...
2
votes
1answer
83 views

Magento 2.0.7 grunt:less problem

I'm using DigitalOcean one-click-install Magento 2.0.7 installation on ubuntu and I have installed nodejs and grunt following the official tutorials. I added my theme to /dev/tools/grunt/configs/...
2
votes
1answer
638 views

Debugging LESS files with Firebug / Chrome Dev tools Magento 2

I am trying to figure out how to display the LESS file and line number pre compilation in developer tools so that I can see where I need to be editing. I have previously got this up and running with ...
2
votes
2answers
1k views

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

My core_config_data table has general/locale/code set to en_IE. When I run grunt exec:<theme-name> and then grunt less:<theme-name>, CSS is generated in two separate locale folders, en_GB ...
2
votes
1answer
293 views

Magento 2 - Grunt Watch in Vagrant Environment

I'm running into this issue where when I ssh into my Vagrant VM and run grunt watch while editing css, it totally boggs down my system. I hear the fan speed up and if left running, my VM grinds to a ...
1
vote
1answer
5k views

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

I NodeJs installed, I installed the Magento2 Grunt that works, but if I run the command "grunt deploy" it delete all from the folder pub/static/ but do not deploy and returns me the error below. Can ...
1
vote
2answers
987 views

Can't get Grunt working for Magento 2

I can't get Grunt working on Magento 2. I'm going through the devdocs and have run the following commands to set up grunt: $ sudo npm install -g grunt-cli /usr/bin/grunt -> /usr/lib/node_modules/...
1
vote
2answers
231 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.