2017 © Pedro Peláez
 

library asset-plugin

Asset Plugin for Tapestry

image

tapestry-cloud/asset-plugin

Asset Plugin for Tapestry

  • Saturday, October 21, 2017
  • by carbontwelve
  • Repository
  • 1 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 4 % Grown

The README.md

Tapetry Asset Plugin

An equivilant to Laravel mix(), (*1)

Packagist Minimum PHP Version Software License Gitmoji , (*2)

Install

To install run: composer require tapestry-cloud/asset-plugin, (*3)

Next you need to update your site configuration to include the path to manifest.json:, (*4)

// ...

    'plugins' => [
        'asset_manifest_path' => __DIR__ . '/rev-manifest.json'
    ],

// ...

Finally within your site Kernel.php you need to register the plugin's service provider:, (*5)

<?php

use Tapestry\Modules\Kernel\KernelInterface;

class Kernel implements KernelInterface
{
    /**
     * @var Tapestry
     */
    private $tapestry;

    public function __construct(Tapestry $tapestry)
    {
        $this->tapestry = $tapestry;
    }

    /**
     * This method is executed by Tapestry when the Kernel is registered.
     *
     * @return void
     */
    public function register()
    {
        // Use project autoloader
        require_once(__DIR__ . '/vendor/autoload.php');
    }

    /**
     * This method of executed by Tapestry as part of the build process.
     *
     * @return void
     */
    public function boot()
    {
        $this->tapestry->register(\TapestryCloud\Asset\ServiceProvider::class);
    }
}

Usage

This plugin adds the $this->asset('main.css') helper, which when paired with a gulp or grunt task that produces a manifest.json file for mapping asset revisions means you don't have to update your html source each time you build your css/js assets., (*6)

The Versions

21/10 2017

dev-master

9999999-dev

Asset Plugin for Tapestry

  Sources   Download

MIT

The Development Requires

21/10 2017

1.0.2

1.0.2.0

Asset Plugin for Tapestry

  Sources   Download

MIT

The Development Requires

17/05 2017

1.0.1

1.0.1.0

Asset Plugin for Tapestry

  Sources   Download

MIT

17/05 2017

1.0.0

1.0.0.0

Asset Plugin for Tapestry

  Sources   Download

MIT