Download the PHP package oleksiibulba/webpack-encore-plugin without Composer
On this page you can find all versions of the php package oleksiibulba/webpack-encore-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download oleksiibulba/webpack-encore-plugin
More information about oleksiibulba/webpack-encore-plugin
Files in oleksiibulba/webpack-encore-plugin
Package webpack-encore-plugin
Short Description This is a Micro plugin for webpack-encore support
License MIT
Informations about the package webpack-encore-plugin
Webpack-Encore plugin for Micro framework
This plugin adds several twig functions that help to include script and style html tags to twig templates from webpack-encore entries.
Get started
Before starting to work with the plugin, all you need is:
- Project based on Micro Framework;
- @symfony/webpack-encore installed by npm or yarn;
Install
You can install the plugin via composer:
Usage
Add OleksiiBulba\WebpackEncorePlugin\WebpackEncorePlugin
to your plugins list:
To use the plugin you need to create an entrypoint in your webpack.config.js:
run build:
and add one of the twig functions to a template:
Here is the signature of the twig functions:
- encore_entry_script_tags | encore_entry_link_tags:
- entryName, type: string, required;
- extraAttributes, type: array, optional, default value: empty array;
- getJavaScriptFiles | getCssFiles | entryExists:
- entryName, type: string, required;
If two or more entries contain common files, then they will be printed only once;
Extra attributes
To add extra attribute to the tags, you can pass them in the array as a second argument, like this:
and as a result, it will print next html (assuming your entrypoint 'app' contains only one file './js/app.js'):
Change Log
Please see CHANGELOG for more information on what has changed recently.
Testing
Contributing
Please feel free to open pull request or create an issue, they are more than welcome! Please see CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Oleksii Bulba
- Fabien Potencier
- All Contributors
The code was taken and adapted from symfony/webpack-encore-bundle
that was created by Symfony Community and Fabien Potencier in particular.
Adapted for Micro framework plugin by Oleksii Bulba.
For the full copyright and license information, please see the License File that was distributed with this source code.
License
The MIT License (MIT). Please see License File for more information.
All versions of webpack-encore-plugin with dependencies
micro/kernel-boot-configuration Version ^1
micro/kernel-boot-plugin-depended Version ^1
micro/plugin-twig Version ^1
symfony/serializer Version ^6.2