Download the PHP package hryvinskyi/magento2-deferjs without Composer
On this page you can find all versions of the php package hryvinskyi/magento2-deferjs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package magento2-deferjs
Magento 2 Defer JavaScripts
The module moves javascripts to the bottom of the page.
Installation Guide
Install by composer
`
Install download package
- Download module https://github.com/hryvinskyi/magento2-base "Clone or download -> Download Zip"
- Download this module "Clone or download -> Download Zip"
- Unzip two modules in the folder app\code\Hryvinskyi\Base and app\code\Hryvinskyi\DeferJs
-
Run commands:
- Configure module in admin panel
General Settings
To get the access to the 'Defer JavaScripts' settings please go to Stores -> Configuration -> Hryvinskyi Extensions -> Defer JavaScripts and expand the General Settings section.
Enabled deferred javascript: Enable or disable the extension from here.
Disable move attribute: Enter the attribute that will block the move of the script to the bottom.
Enabled minify body scripts: Enable script minification.
Features
- Ability to skip javascripts with a special tag that can be set in the admin panel
- Built-in skipping move Google tag manager (If you use a third-party module and can not add a special tag)
-
Exclude by controllers from defer parsing of JavaScript.
Controller will be unaffected by defer js. Use like: [module][controller][action] (Example: cms_index_index)
-
Exclude by store paths from defer parsing of JavaScript.
Paths will be unaffected by defer js. Use like: /women/tops-women/jackets-women.html
-
Exclude by url pattern from defer parsing of JavaScript.
URL pattern can be a full action name or a request path. Wildcards are allowed. Like:
- Minification of moved javascripts
- Optimize text/x-magento-init scripts
- Ability to extend the module with your validator
- Increased rendering time improves the Google Page Speed score.
Add custom validator
To add your validator:
-
Create Validator file
app/code/Vendor/Module/Model/PassesValidator/Validators/YourValidator.php
: -
Create Dependency Injection file
app/code/Vendor/Module/etc/frontend/di.xml
: - Run command:
All versions of magento2-deferjs with dependencies
magento/framework Version *
magento/module-store Version *
hryvinskyi/magento2-base Version ~2.1.0