Download the PHP package davidhirtz/yii2-vite without Composer
On this page you can find all versions of the php package davidhirtz/yii2-vite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davidhirtz/yii2-vite
More information about davidhirtz/yii2-vite
Files in davidhirtz/yii2-vite
Package yii2-vite
Short Description Vite integration for Yii 2 framework
License proprietary
Homepage https://www.github.com/davidhirtz/yii2-vite
Informations about the package yii2-vite
yii2-vite
Vite for the Yii 2 skeleton: registers an entry's script,
stylesheets and modulepreload links from Vite's manifest, or from the dev server while it runs.
Version 3 requires davidhirtz/yii2-skeleton ^3.8. Projects outside the skeleton stay on ^0.5 (branch v0).
Vite
build.manifest is required. The defaults below expect the build in web/dist:
Configuration
The bundle registers the vite component, so a project configures only what differs from these defaults:
While useDevServer is on, every request checks for the dev server by opening a TCP connection to
devServerInternalUrl, at most devServerTimeout long. When it answers, entries load from it with @vite/client
for hot module replacement; when not, from the manifest. checkDevServer => false skips the check and always uses
the dev server.
Inline stylesheets
With inlineCssMaxSize set, an entry whose stylesheets together are no larger than that many bytes renders them as
<style> tags instead of links, saving the render-blocking request. It suits a small site that loads the page once
and swaps the content afterwards (AjaxRouteTrait): registered in the layout, the styles reach the first response
alone. An entry's stylesheets are inlined all or none, so their order holds; one an earlier entry already linked or
inlined stays as it is. Relative url()s and the source map comment are made absolute against baseUrl. The dev
server always links.
An inlined stylesheet is not cached by the browser, so every full page load carries it again.
Usage
Script and modulepreload tags carry the view's CSP nonce. A sha384 integrity in the manifest (as written by
e.g. vite-plugin-manifest-sri) is added to both.