magento2-module-less-js-compiler | Allows Magento 2 to compile less files
kandi X-RAY | magento2-module-less-js-compiler Summary
kandi X-RAY | magento2-module-less-js-compiler Summary
magento2-module-less-js-compiler is a PHP library. magento2-module-less-js-compiler has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.
This module was built out of frustration about the slow deployments of static assets to a production environment while running bin/magento setup:static-content:deploy. In particular this module tries to tackle the slowness which comes with compiling less files using the less.php library, which Magento 2 uses by default. This module provides a solution by using the original less.js compiler which was written in javascript and is executed through node.js We have benchmarked the difference between the less.php and less.js compilers, and the less.js compiler is somewhere between 1.5 and 3 times as fast as the less.php compiler, although it depends on your PHP version. If you run PHP 5.x the performance increase will be much higher, PHP 7.x is actually quite fast by itself, but the nodejs version still beats it. Update: Since Magento 2.3.0, it seems like the performance differences between less.php and less.js are not very big anymore. I have the suspicion this might have something to do with newer releases of the less.php library. Which got released somewhere around the period when Magento 2.2.3 & 2.1.12 were released. So it's possible that the performance difference for Magento 2.2.x and 2.1.x might also be less significant then how it's displayed below if you upgrade the less.php library to the latest version (v1.7.0.14 at the time of writing). This is a bit of speculation, since unfortunately I didn't keep track of the version of the less.php library which I've used in the benchmarks, so I'm not sure about this statement. Since Magento 2.4.0 (or newer PHP versions?), the performance differences seems to have changed in favor of less.php. But you might still want to use this module so that the outputted css is the same between your local development environment and a production environment.
This module was built out of frustration about the slow deployments of static assets to a production environment while running bin/magento setup:static-content:deploy. In particular this module tries to tackle the slowness which comes with compiling less files using the less.php library, which Magento 2 uses by default. This module provides a solution by using the original less.js compiler which was written in javascript and is executed through node.js We have benchmarked the difference between the less.php and less.js compilers, and the less.js compiler is somewhere between 1.5 and 3 times as fast as the less.php compiler, although it depends on your PHP version. If you run PHP 5.x the performance increase will be much higher, PHP 7.x is actually quite fast by itself, but the nodejs version still beats it. Update: Since Magento 2.3.0, it seems like the performance differences between less.php and less.js are not very big anymore. I have the suspicion this might have something to do with newer releases of the less.php library. Which got released somewhere around the period when Magento 2.2.3 & 2.1.12 were released. So it's possible that the performance difference for Magento 2.2.x and 2.1.x might also be less significant then how it's displayed below if you upgrade the less.php library to the latest version (v1.7.0.14 at the time of writing). This is a bit of speculation, since unfortunately I didn't keep track of the version of the less.php library which I've used in the benchmarks, so I'm not sure about this statement. Since Magento 2.4.0 (or newer PHP versions?), the performance differences seems to have changed in favor of less.php. But you might still want to use this module so that the outputted css is the same between your local development environment and a production environment.
Support
Quality
Security
License
Reuse
Support
magento2-module-less-js-compiler has a low active ecosystem.
It has 22 star(s) with 3 fork(s). There are 5 watchers for this library.
It had no major release in the last 6 months.
There are 1 open issues and 0 have been closed. There are no pull requests.
It has a neutral sentiment in the developer community.
The latest version of magento2-module-less-js-compiler is v1.5.1
Quality
magento2-module-less-js-compiler has no bugs reported.
Security
magento2-module-less-js-compiler has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
License
magento2-module-less-js-compiler is licensed under the MIT License. This license is Permissive.
Permissive licenses have the least restrictions, and you can use them in most projects.
Reuse
magento2-module-less-js-compiler releases are not available. You will need to build from source code and install.
Installation instructions, examples and code snippets are available.
Top functions reviewed by kandi - BETA
kandi has reviewed magento2-module-less-js-compiler and discovered the below as its top functions. This is intended to give you an instant insight into magento2-module-less-js-compiler implemented functionality, and help decide if they suit your requirements.
- Process less file .
- Compile a file .
- Get the path to the less compiler .
- Get the path to the nodejs binary .
- Output an error message .
- Get compiler arguments .
- Get the node arguments as a string .
Get all kandi verified functions for this library.
magento2-module-less-js-compiler Key Features
No Key Features are available at this moment for magento2-module-less-js-compiler.
magento2-module-less-js-compiler Examples and Code Snippets
No Code Snippets are available at this moment for magento2-module-less-js-compiler.
Community Discussions
No Community Discussions are available at this moment for magento2-module-less-js-compiler.Refer to stack overflow page for discussions.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install magento2-module-less-js-compiler
First, we recommend you to install the less compiler itself, and save it into your package.json file as a production dependency:. Watch out: from Magento 2.1 onwards, the package.json file is being renamed to package.json.sample to enable you to have your own nodejs dependencies without Magento overwriting this every time with its own version each time you update Magento. So if you use Magento >= 2.1 make sure you copy the package.json.sample file to package.json before running the above command if you want to work with Magento's grunt setup. Then run a shrinkwrap, so the version of less (and its dependencies) are fixed, this will produce a file npm-shrinkwrap.json with the exact versions of all your nodejs production dependencies and their own dependencies, so you can be sure it will use those exact versions when you install this on another machine. And make sure you add these two files to your version control system. For an analogy with composer, you can compare the package.json file with composer.json, and npm-shrinkwrap.json with composer.lock. Now install this module. And enable it in Magento. As the last step, in your deploy scripts, make sure you call npm install --production. You should execute this somewhere between composer install and bin/magento setup:static-content:deploy.
Support
For any new features, suggestions and bugs create an issue on GitHub.
If you have any questions check and ask questions on community page Stack Overflow .
Find more information at:
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page