Skip to content

Latest commit

 

History

History
62 lines (54 loc) · 1.92 KB

README.md

File metadata and controls

62 lines (54 loc) · 1.92 KB

gulp-assets

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>