Download the PHP package ibertrand/magento2-terser without Composer

On this page you can find all versions of the php package ibertrand/magento2-terser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento2-terser

Magento 2 Terser

A Bash script that uses terser to minify your JavaScript files and can be run in the root directory of your Magento 2 installation.

The script will minify all JavaScript files in the pub/static/frontend directory of your Magento 2 installation, except for those that are already minified or the requirejs-bundle-config.js file. The minification tasks can be run in parallel for increased performance.

Installation

You can install the package using Composer. Run the following command in your terminal:

Alternatively, you can download the file minify-m2-scripts.sh directly and save it wherever you want.

The script requires the terser command to be available. If you don't have it installed, you can install it globally with npm:

If you don't have npm installed, you need to install it first.

Usage

To run the script, open a terminal in the root directory of your Magento 2 installation and run:

This is assuming you installed the package using Composer. If you downloaded the file directly, you need to run the script with the full path to the file.

By default, the script will minify all JavaScript files in the pub/static/frontend directory of your Magento 2 installation, except for those that are already minified or the requirejs-bundle-config.js file.

The original files will be replaced with the minified versions. If your M2 instance is in developer mode, this might alter files outside of the pub/static/frontend directory because of symlinks.

You can run the script with the -v or --verbose flag to display the name of each file that is being minified. Alternatively, you can run it with --no-progress-bar or with --silent, which includes --no-progress-bar.

Parallel execution

The script supports parallel execution of minification tasks to speed up the process. To specify the number of jobs to run in parallel, you can use the -j option followed by the number of jobs or --jobs= followed by the number of jobs.

For example, to run 3 jobs in parallel, you could use either of the below commands:

License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of magento2-terser with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ibertrand/magento2-terser contains the following files

Loading the files please wait ....