adambisek/gulp-assets

v1.1.0 2016-06-03 08:32 UTC

This package is not auto-updated.

Last update: 2024-12-21 21:08:34 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version License

This component is intended to use with Nette Framework. When you are using gulp for processing assets, you don't need Webloader anymore. Simply link gulp processed assets to page. Adds file hash into query string to force refresh after gulp process new files.

Installation

Preferred installation is with Composer.

composer require adambisek/gulp-assets

Usage

config.neon -> simple define output gulp files a define factory service

parameters:
	assetsFactory:
		basePath: '%appDir%/../public'
		front:
			css:
				dist/front/front.bundle.css: all
				dist/front/front-print.bundle.css: all
			js:
				- dist/front/front.bundle.js

services:
	- GulpAssets\ControlFactory(%assetsFactory%)

BasePresenter -> create renderable components with factory service

public function createComponentCss()
{
	return $this->assetsControlFactory->createCssControl('front');
}

public function createComponentJs()
{
	return $this->assetsControlFactory->createJsControl('front');
}

Template (Latte):

<html>
	<head>
		{control js}
		{control css}
	</head>
	<body> ... </body>
</html>