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.
Preferred installation is with Composer.
composer require adambisek/gulp-assets
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>