{"id":16675908,"url":"https://github.com/oleksiibulba/webpack-encore-plugin","last_synced_at":"2025-04-09T20:32:59.546Z","repository":{"id":64785322,"uuid":"576747291","full_name":"OleksiiBulba/webpack-encore-plugin","owner":"OleksiiBulba","description":"This is a Micro-PHP plugin for webpack-encore support","archived":false,"fork":false,"pushed_at":"2023-05-04T09:04:58.000Z","size":70,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T22:26:41.932Z","etag":null,"topics":["micro-php-framework","php","webpack-encore"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OleksiiBulba.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-10T21:08:23.000Z","updated_at":"2024-09-20T14:17:44.000Z","dependencies_parsed_at":"2025-02-15T21:31:57.375Z","dependency_job_id":null,"html_url":"https://github.com/OleksiiBulba/webpack-encore-plugin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OleksiiBulba%2Fwebpack-encore-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OleksiiBulba%2Fwebpack-encore-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OleksiiBulba%2Fwebpack-encore-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OleksiiBulba%2Fwebpack-encore-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OleksiiBulba","download_url":"https://codeload.github.com/OleksiiBulba/webpack-encore-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248107752,"owners_count":21048995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["micro-php-framework","php","webpack-encore"],"created_at":"2024-10-12T13:08:24.377Z","updated_at":"2025-04-09T20:32:59.525Z","avatar_url":"https://github.com/OleksiiBulba.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webpack-Encore plugin for Micro framework\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE.md)\n[![Total Downloads][ico-downloads]][link-downloads]\n[![Scrutinizer Code Quality][ico-scrutinizer-quality]][link-scrutinizer-quality]\n[![Code Coverage][ico-scrutinizer-coverage]][link-scrutinizer-coverage]\n[![Build Status][ico-scrutinizer-build]][link-scrutinizer-build]\n\nThis plugin adds several twig functions that help to include script and style html tags to twig templates from webpack-encore entries.\n\n## Get started\n\nBefore starting to work with the plugin, all you need is:\n* Project based on [Micro Framework][link-microframework];\n* [@symfony/webpack-encore][link-symfony-webpack-encore] installed by npm or yarn;\n\n### Install\n\n  You can install the plugin via composer:\n```bash\ncomposer require oleksiibulba/webpack-encore-plugin\n```\n\n### Usage\n\nAdd `OleksiiBulba\\WebpackEncorePlugin\\WebpackEncorePlugin` to your plugins list:\n```php\n\u003c?php /* ./etc/plugins.php */\n\nreturn [\n    // List of plugins:\n    // ...\n    OleksiiBulba\\WebpackEncorePlugin\\WebpackEncorePlugin::class,\n    // ...\n];\n```\n\nTo use the plugin you need to create an entrypoint in your webpack.config.js:\n```javascript\n/* ./webpack.config.js */\nconst Encore = require('@symfony/webpack-encore');\nEncore\n    /* ... */\n    .addEntry('your_entry_name', './path/to/your_entry_file.jsx')\n    /* ... */\n```\n\nrun build:\n```bash\nyarn dev\n// or\nnpm dev\n```\n\nand add one of the twig functions to a template:\n```html\n{# ./templates/base.html.twig #}\n{# ... #}\n\u003chead\u003e\n    {{ encore_entry_script_tags('your_entry_name') }}\n    {{ encore_entry_link_tags('your_entry_name') }}\n\u003c/head\u003e\n{# ... #}\n```\n\nHere is the signature of the twig functions:\n* encore_entry_script_tags | encore_entry_link_tags:\n  * entryName, type: string, required;\n  * extraAttributes, type: array, optional, default value: empty array;\n* getJavaScriptFiles | getCssFiles | entryExists:\n  * entryName, type: string, required;\n\nIf two or more entries contain common files, then they will be printed only once;\n\n#### Extra attributes\nTo add extra attribute to the tags, you can pass them in the array as a second argument, like this:\n```html\n\u003chead\u003e\n    {{ encore_entry_script_tags('your_entry_name', {'defer':true}) }}\n\u003c/head\u003e\n```\nand as a result, it will print next html (assuming your entrypoint 'app' contains only one file './js/app.js'):\n```html\n\u003chead\u003e\n    \u003cscript href=\"/js/app.js\" type=\"application/javascript\" defer\u003e\u003c/script\u003e\n\u003c/head\u003e\n```\n\n## Change Log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Contributing\n\nPlease feel free to open pull request or create an issue, they are more than welcome!\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email oleksii_bulba@epam.com instead of using the issue tracker.\n\n## Credits\n\n- [Oleksii Bulba][link-author]\n- [Fabien Potencier][email-fabien]\n- [All Contributors][link-contributors]\n\nThe code was taken and adapted from `symfony/webpack-encore-bundle` that was created by [Symfony Community](https://symfony.com/contributors) and [Fabien Potencier](mailto:fabien@symfony.com) in particular.\nAdapted for Micro framework plugin by [Oleksii Bulba][link-author].\n\nFor the full copyright and license information, please see the [License File](LICENSE.md) that was distributed with this source code.\n\n## License\n\n[The MIT License (MIT)][link-license]. Please see [License File](LICENSE.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/oleksiibulba/webpack-encore-plugin.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/oleksiibulba/webpack-encore-plugin.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/oleksiibulba/webpack-encore-plugin.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/oleksiibulba/webpack-encore-plugin.svg?style=flat-square\n\n[ico-scrutinizer-quality]: https://img.shields.io/scrutinizer/quality/g/OleksiiBulba/webpack-encore-plugin/master?style=flat-square\n[ico-scrutinizer-coverage]: https://img.shields.io/scrutinizer/coverage/g/OleksiiBulba/webpack-encore-plugin/master?style=flat-square\n[ico-scrutinizer-build]: https://img.shields.io/scrutinizer/build/g/OleksiiBulba/webpack-encore-plugin/master?style=flat-square\n\n[link-scrutinizer-quality]: https://scrutinizer-ci.com/g/OleksiiBulba/webpack-encore-plugin/?branch=master\n[link-scrutinizer-coverage]: https://scrutinizer-ci.com/g/OleksiiBulba/webpack-encore-plugin/?branch=master\n[link-scrutinizer-build]: https://scrutinizer-ci.com/g/OleksiiBulba/webpack-encore-plugin/build-status/master\n\n[link-microframework]: https://github.com/Micro-PHP/skeleton\n[link-symfony-webpack-encore]: https://www.npmjs.com/package/@symfony/webpack-encore\n[link-packagist]: https://packagist.org/packages/oleksiibulba/webpack-encore-plugin\n[link-travis]: https://travis-ci.org/oleksiibulba/webpack-encore-plugin\n[link-scrutinizer]: https://scrutinizer-ci.com/g/oleksiibulba/webpack-encore-plugin/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/oleksiibulba/webpack-encore-plugin\n[link-downloads]: https://packagist.org/packages/oleksiibulba/webpack-encore-plugin\n[link-author]: https://github.com/OleksiiBulba\n[link-contributors]: ../../contributors\n[link-license]: https://opensource.org/licenses/MIT\n[email-fabien]: mailto:fabien@symfony.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleksiibulba%2Fwebpack-encore-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleksiibulba%2Fwebpack-encore-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleksiibulba%2Fwebpack-encore-plugin/lists"}