pug-php / pug-assets
Pug template assets manager
Fund package maintenance!
kylekatarnls
Open Collective
Tidelift
Installs: 78 315
Dependents: 4
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.4
- pug-php/pug: ^2.0.2 || ^3.0.0
- pug-php/pug-filter-coffee-script: ^1.2
- pug-php/pug-filter-less: ^1.0
- pug-php/pug-filter-markdown: ^1.1
- pug-php/pug-filter-react: ^1.0
- pug-php/pug-filter-stylus: ^2.0
- pug-php/pug-minify: ^1.1
Requires (Dev)
- phpunit/phpunit: ^4.8.36 || ^5.7.27 || ^8.5.15
This package is auto-updated.
Last update: 2024-10-29 05:09:29 UTC
README
Manage your assets and third-party transpiler (less, stylus, coffee, babel, etc.) and allow you to concat and/or minify them in production environment.
Install
First you need composer if you have'nt yet: https://getcomposer.org/download/
Then in the root directory of your project, open a terminal and enter:
composer require pug-php/pug-assets
Enable the plugin:
use Pug\Assets; use Pug\Pug; $pug = new Pug(); // The facade syntax: Assets::enable($pug); $pug->render('... minify ...'); // here you can use minfiy, assets or concat keywords to wrap your assets Assets::disable($pug); $pug->render('... minify ...'); // here minfiy, assets or concat are simple tags again // Or the instanciation syntax: $assets = new Assets($pug); $pug->render('... minify ...'); // here you can use minfiy, assets or concat keywords to wrap your assets unset($assets); $pug->render('... minify ...'); // here minfiy, assets or concat are simple tags again
For more information about the concat/minify usage, see https://github.com/pug-php/pug-minify#readme
Pug-Assets also instal the coffee, react-jsx, stylus, less and markdown pug filters to use them as inline contents.