{"repo":"idleberg/php-wordpress-vite-assets","free":true,"listed":false,"github":"https://github.com/idleberg/php-wordpress-vite-assets","clone":"git clone https://github.com/idleberg/php-wordpress-vite-assets.git","description":"Injects assets from a Vite manifest to the Wordpress head, supports themes and plugins","language":"PHP","stars":150,"topics":["manifest-json","vite","vitejs","wordpress"],"license":"MIT","category":"self-hosted-apps","readme_excerpt":"Vite Assets for WordPress Adds assets from a Vite manifest to the WordPress head, supports themes and plugins. Table of contents - Installation - Usage - Methods - inject() - getScriptTag() - getStyleTags() - getPreloadTags() - Options - option.action - option.crossorigin - option.integrity - option.priority - License Installation composer require idleberg/wordpress-vite-assets Usage To get you going, first instantiate the class exposed by this library Parameters $manifestPath Type: string Specifies the path to the manifest. $baseUri Type: string Specifies the base URI for the assets in the manifest. $algorithm Type: \"sha256\" \"sha384\" \"sha512\" \":manifest:\" Default: \"sha256\" Specifies the algorithm used for hashing the assets. This will be used for subsource integrity when printing script or style tags. [!TIP] You can use \":manifest:\" in conjunction with vite-plugin-manifest-sri, a plug-in that calculates the hashes at build-time and adds them to the manifest. Example Methods inject() Usage: inject(array string $entrypoints, array $options = []) Injects tags for entries specified in the manifest to the page header - script entrypoint - preloads for imported scripts - style tags getScriptTag() Usage: getScriptTag(string $entrypoint, array $options = []) Returns the script tag for an entry in the manifest getStyleTags() Usage: getStyleTags(string $entrypoint, array $options = []) Returns the style tags for an entry in the manifest getPreloadTags() Usage: getPreloadTags(string $e","default_branch":null,"files":null,"tree":[],"storefront":"/r/idleberg","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/idleberg/php-wordpress-vite-assets/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}