Download the PHP package kasparsd/minit without Composer

On this page you can find all versions of the php package kasparsd/minit. 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 minit

Minit for WordPress

Test

Places all your CSS and Javascript files into dedicated bundles that can be cached by browsers and re-used between requests. It assumes that a single request with slightly larger transfer size is more performant than multiple smaller requests (even with HTTP/2 multiplexing).

Install

Install using Composer:

composer require kasparsd/minit

or by manually downloading the latest release file.

How it Works

Screenshots

  1. All CSS files combined in a single file
  2. All external Javascript files loading asynchronously

Configuration

See the Wiki for additional documentation.

Disable Deferring Javascript

Use the minit-script-tag-async filter (legacy name when async was preferred) to load the concatenated Javascript synchronously:

add_filter( 'minit-script-tag-async', '__return_false' );

Exclude Files

Use the minit-exclude-js and minit-exclude-css filters to exclude files from the concatenated bundles:

add_filter( 'minit-exclude-js', function( $handles, $enqueued ) {
    $handles[] = 'jquery';

    return $handles;
}, 10, 2 );

where $handles is an array of handles to exclude, and $enqueued is an array of all enqueued handles of the given type.

Integrate with Block Themes

Full block-based themes enqueue the individual stylesheets only for the blocks that are required for the current request. This leads to bundles being unique between requests thus defeating the purpose or cache re-use. Use the should_load_separate_core_block_assets filter to enqueue a single block-library stylesheet instead on all requests:

add_action(
    'plugins_loaded',
    function () {
        if ( class_exists( 'Minit_Plugin' ) ) {
            // Add late to override the default behaviour.
            add_filter( 'should_load_separate_core_block_assets', '__return_false', 20 );
        }
    },
    100 // Do it after all plugins are loaded.
);

Minify CSS

Use this filter to apply basic CSS minification to the created bundle:

add_filter(
    'minit-content-css',
    function ( $css ) {
            $css = preg_replace( '/[\n\r\t]/mi', ' ', $css ); // Line breaks to spaces.
            $css = preg_replace( '/\s+/mi', ' ', $css ); // Multiple spaces to single spaces.

            return $css;
    },
    5 // Do it before the debug comment in the head.
);

Minit Addons

Contribute

Requirements:

To setup the development environment:

  1. Clone this repository.
  2. Run npm install to install the dependencies (which also runs composer install).
  3. Run npm run start to start the included WordPress development environment.
  4. Run npm run test and npm run lint to run the tests.

Credits

Created by Kaspars Dambis and contributors.


All versions of minit with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 kasparsd/minit contains the following files

Loading the files please wait ...