freshheads/webpack-bundle
最新稳定版本:3.0.0
Composer 安装命令:
composer require freshheads/webpack-bundle
包简介
A Symfony bundle to create paths to webpack assets in your Twig templates.
README 文档
README
A Symfony bundle to create paths to webpack assets in your Twig templates. This bundle uses the webpack statistics file to find the newest assets for a given webpack entry.
Installation
Install with composer:
composer require freshheads/webpack-bundle
Register the bundle
// config/bundles.php return [ // ... FH\Bundle\WebpackBundle\FHWebpackBundle::class => [ 'all' => true ] ];
Configuration
All configuration options, with default values:
fh_webpack: stats_filename: stats.json # web/document root, assets will be referenced from this path web_dir: '%kernel.project_dir%/public'
Usage
Link webpack files
<link rel="stylesheet" href="{{ webpack_asset('assets/frontend/build', 'app', 'css') }}" /> <script type="text/javascript" src="{{ webpack_asset('assets/frontend/build', 'app', 'js') }}"></script>
Dump the contents of a webpack file
<style type="text/css"> {{ webpack_asset_contents('assets/frontend/build', 'email', 'css')|raw }} </style>
Requirements
This library works with PHP version 8.1 and up.
统计信息
- 总下载量: 88.84k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-07