{"id":13405040,"url":"https://github.com/Machy8/webloader","last_synced_at":"2025-03-14T09:32:11.011Z","repository":{"id":45268966,"uuid":"105685469","full_name":"Machy8/webloader","owner":"Machy8","description":"📦  Simple, easy to use, php bundler for javascript and css.","archived":false,"fork":false,"pushed_at":"2021-12-26T18:40:25.000Z","size":309,"stargazers_count":19,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-10T16:00:46.919Z","etag":null,"topics":["build-tool","css","frontend","javascript","module-bundler","webloader"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Machy8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-03T18:06:51.000Z","updated_at":"2024-02-21T15:18:01.000Z","dependencies_parsed_at":"2022-08-30T17:02:04.254Z","dependency_job_id":null,"html_url":"https://github.com/Machy8/webloader","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Machy8%2Fwebloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Machy8%2Fwebloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Machy8%2Fwebloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Machy8%2Fwebloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Machy8","download_url":"https://codeload.github.com/Machy8/webloader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243554160,"owners_count":20309873,"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":["build-tool","css","frontend","javascript","module-bundler","webloader"],"created_at":"2024-07-30T19:01:54.919Z","updated_at":"2025-03-14T09:32:10.683Z","avatar_url":"https://github.com/Machy8.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n \u003cimg src=\"https://github.com/Machy8/webloader/blob/master/logo.png\" alt=\"\"\u003e\n \u003cbr\u003e\n \u003ca href=\"https://travis-ci.org/Machy8/webloader\"\u003e\n   \u003cimg src=\"https://travis-ci.org/Machy8/webloader.svg?branch=master\" alt=\"\"\u003e\n \u003c/a\u003e\n \u003ca href=\"https://coveralls.io/github/Machy8/webloader?branch=master\"\u003e\n   \u003cimg src=\"https://coveralls.io/repos/github/Machy8/webloader/badge.svg?branch=master\" alt=\"\"\u003e\n \u003c/a\u003e\n \u003ca href=\"https://github.com/Machy8/webloader\"\u003e\n   \u003cimg src=\"https://img.shields.io/packagist/dm/machy8/webloader.svg\" alt=\"\"\u003e\n \u003c/a\u003e\n \u003ca href=\"https://packagist.org/packages/machy8/webloader\"\u003e\n   \u003cimg src=\"https://img.shields.io/packagist/dt/machy8/webloader.svg?style=flat\" alt=\"\"\u003e\n \u003c/a\u003e\n\u003c/h1\u003e\n\n📦 Simple, easy to use, php bundler for javascript and css.\n\n## In a nutshell\n- **Configurable**: in one file (example bellow or in docs)\n- Files **[collections](https://github.com/Machy8/webloader/blob/master/docs/Files%20collections.md)** and **[containers](https://github.com/Machy8/webloader/blob/master/docs/Files%20collections%20containers.md)**: makes assets organizing incredibly simple\n- **[Filters](https://github.com/Machy8/webloader/blob/master/docs/Filters.md)**: callable in two different ways\n- **[Path placeholders](https://github.com/Machy8/webloader/blob/master/docs/Placeholders.md)**: reusable paths to files, less writing\n- Allows you to load **remote** and **local** files\n- If you have some critical css, you can load it directly into the page with minimal configuration required\n- **Prepared for read only deployment** - webloader is able to compile all files collections at once\n- **[Debugger bar](https://github.com/Machy8/webloader/blob/master/docs/Tracy%20bridge.md)** for [Tracy](https://tracy.nette.org/cs/)\n\n## Requirements\n- PHP 8.0+\n- If you use Nette Framework - v2.4+\n\n## Installation\n```\n composer require machy8/webloader\n```\n\n## Docs\n- [Files collections](https://github.com/Machy8/webloader/blob/master/docs/Files%20collections.md)\n- [Files collections containers](https://github.com/Machy8/webloader/blob/master/docs/Files%20collections%20containers.md)\n- [Filters](https://github.com/Machy8/webloader/blob/master/docs/Filters.md)\n- [Placeholders](https://github.com/Machy8/webloader/blob/master/docs/Placeholders.md)\n- [Tracy bridge](https://github.com/Machy8/webloader/blob/master/docs/Tracy%20bridge.md)\n\n## Quick start\nLet's say we have two css files (**styla-a.css** and **style-b.css**) and we want to bundle them into one file which name will be **my-bundle**. This bundle will be stored in a **webtemp dir** (must be accessible from a browser).\n\nThe recommended way to configure Web Loader is through neon configuration files. The first step is to create a bundle.neon.\n````yaml\nmy-bundle:\n    cssFiles:\n        - path/to/style-a.css\n        - path/to/style-b.css\n````\n\nNext step is to init Web Loader, set the output dir path and tell him to create bundles from **bundle.neon**.\n````PHP\n$webloader = new \\WebLoader\\Engine('path/to/webtemp');\n$webloader-\u003ecreateFilesCollectionsFromConfig('path/to/bundle.neon');\n````\n\nThe last step is to call files collections render to render css files collection named my-bundle.\n````PHP\necho $webloader-\u003egetFilesCollectionRender()-\u003ecss('my-bundle');\n````\n\nThe PHP file after the last edit will looks like this:\n````PHP\n$webloader = new \\WebLoader\\Engine('path/to/output/dir');\n$webloader-\u003ecreateFilesCollectionsFromConfig('path/to/bundle.neon');\n\necho $webloader-\u003egetFilesCollectionRender()-\u003ecss('my-bundle');\n````\n\nThe output will be similiar to the following code:\n````html\n\u003clink type=\"text/css\" rel=\"stylesheet\" href=\"/path/to/webtemp/my-bundle.css?v=1512829634\"\u003e\n````\n\n## Quick start (for Nette Framework)\nFor the Nette Framework it is very similar. First of all, register Web Loader extension.\n\n````yaml\nextensions:\n    webloader: WebLoader\\Bridges\\Nette\\WebLoaderExtension\n````\n\nNext step is to add Web Loader section with my-bundle collection configuration inside.\n````yaml\nwebloader:\n    filesCollections:\n        my-bundle:\n            cssFiles:\n                - path/to/style-a.css\n                - path/to/style-b.css\n````\n\nIn your presenter, inject the engine...\n````PHP\n/**\n * @var Engine\n */\nprivate $webLoader;\n\n\npublic function __construct(\\WebLoader\\Engine $engine)\n{\n    $this-\u003ewebLoader = $engine;\n}\n````\n\nand set template parameters (for example in the **beforeRender** method).\n````PHP\npublic function beforeRender()\n{\n    $this-\u003etemplate-\u003ewebloaderFilesCollectionRender = $this-\u003ewebLoader-\u003egetFilesCollectionRender();\n}\n````\n\nThe last step is to call the render in a latte template.\n````LATTE\n{$webloaderFilesCollectionRender-\u003ecss('my-bundle')|noescape}\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMachy8%2Fwebloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMachy8%2Fwebloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMachy8%2Fwebloader/lists"}