class Vite implements Htmlable (View source)
| Macroable |
| static protected array | $macros | The registered string macros. | from Macroable |
| protected string|null | $nonce | The Content Security Policy nonce to apply to all generated tags. | |
| protected string|false | $integrityKey | The key to check for integrity hashes within the manifest. | |
| protected array | $entryPoints | The configured entry points. | |
| protected string|null | $hotFile | The path to the "hot" file. | |
| protected string | $buildDirectory | The path to the build directory. | |
| protected string | $manifestFilename | The name of the manifest file. | |
| protected callable|null | $assetPathResolver | The custom asset path resolver. | |
| protected array | $scriptTagAttributesResolvers | The script tag attributes resolvers. | |
| protected array | $styleTagAttributesResolvers | The style tag attributes resolvers. | |
| protected array | $preloadTagAttributesResolvers | The preload tag attributes resolvers. | |
| protected array | $preloadedAssets | The preloaded assets. | |
| static protected array | $manifests | The cached manifest files. |
| static void | macro(string $name, object|callable $macro)
Register a custom macro. | from Macroable |
| static void | mixin(object $mixin, bool $replace = true)
Mix another object into the class. | from Macroable |
| static bool | hasMacro(string $name)
Checks if macro is registered. | from Macroable |
| static void | flushMacros()
Flush the existing macros. | from Macroable |
| static mixed | __callStatic(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| mixed | __call(string $method, array $parameters)
Dynamically handle calls to the class. | from Macroable |
| array | preloadedAssets()
Get the preloaded assets. | |
| string|null | cspNonce()
Get the Content Security Policy nonce applied to all generated tags. | |
| string | useCspNonce(string|null $nonce = null)
Generate or set a Content Security Policy nonce to apply to all generated tags. | |
| $this | useIntegrityKey(string|false $key)
Use the given key to detect integrity hashes in the manifest. | |
| $this | withEntryPoints(array $entryPoints)
Set the Vite entry points. | |
| $this | useManifestFilename(string $filename)
Set the filename for the manifest file. | |
| $this | createAssetPathsUsing(callable|null $resolver)
Resolve asset paths using the provided resolver. | |
| string | hotFile()
Get the Vite "hot" file path. | |
| $this | useHotFile(string $path)
Set the Vite "hot" file path. | |
| $this | useBuildDirectory(string $path)
Set the Vite build directory. | |
| $this | useScriptTagAttributes($attributes)
Use the given callback to resolve attributes for script tags. | |
| $this | useStyleTagAttributes($attributes)
Use the given callback to resolve attributes for style tags. | |
| $this | usePreloadTagAttributes($attributes)
Use the given callback to resolve attributes for preload tags. | |
| HtmlString | __invoke(string|string[] $entrypoints, string|null $buildDirectory = null)
Generate Vite tags for an entrypoint. | |
| string | makeTagForChunk(string $src, string $url, array|null $chunk, array|null $manifest)
Make tag for the given chunk. | |
| string | makePreloadTagForChunk(string $src, string $url, array $chunk, array $manifest)
Make a preload tag for the given chunk. | |
| array | resolveScriptTagAttributes(string $src, string $url, array|null $chunk, array|null $manifest)
Resolve the attributes for the chunks generated script tag. | |
| array | resolveStylesheetTagAttributes(string $src, string $url, array|null $chunk, array|null $manifest)
Resolve the attributes for the chunks generated stylesheet tag. | |
| array|false | resolvePreloadTagAttributes(string $src, string $url, array $chunk, array $manifest)
Resolve the attributes for the chunks generated preload tag. | |
| string | makeTag(string $url) deprecated
Generate an appropriate tag for the given URL in HMR mode. | |
| string | makeScriptTag(string $url) deprecated
Generate a script tag for the given URL. | |
| string | makeStylesheetTag(string $url) deprecated
Generate a stylesheet tag for the given URL in HMR mode. | |
| string | makeScriptTagWithAttributes(string $url, array $attributes)
Generate a script tag with attributes for the given URL. | |
| string | makeStylesheetTagWithAttributes(string $url, array $attributes)
Generate a link tag with attributes for the given URL. | |
| bool | isCssPath(string $path)
Determine whether the given path is a CSS file. | |
| array | parseAttributes(array $attributes)
Parse the attributes into key="value" strings. | |
| HtmlString|void | reactRefresh()
Generate React refresh runtime script. | |
| string | hotAsset($asset)
Get the path to a given asset when running in HMR mode. | |
| string | asset(string $asset, string|null $buildDirectory = null)
Get the URL for an asset. | |
| string | content(string $asset, string|null $buildDirectory = null)
Get the content of a given asset. | |
| string | assetPath(string $path, bool|null $secure = null)
Generate an asset path for the application. | |
| array | manifest(string $buildDirectory)
Get the manifest file for the given build directory. | |
| string | manifestPath(string $buildDirectory)
Get the path to the manifest file for the given build directory. | |
| string|null | manifestHash(string|null $buildDirectory = null)
Get a unique hash representing the current manifest, or null if there is no manifest. | |
| array | chunk(array $manifest, string $file)
Get the chunk for the given entry point / asset. | |
| bool | isRunningHot()
Determine if the HMR server is running. | |
| string | toHtml()
Get the Vite tag content as a string of HTML. |
Register a custom macro.
Mix another object into the class.
Checks if macro is registered.
Flush the existing macros.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Get the preloaded assets.
Get the Content Security Policy nonce applied to all generated tags.
Generate or set a Content Security Policy nonce to apply to all generated tags.
Use the given key to detect integrity hashes in the manifest.
Set the Vite entry points.
Set the filename for the manifest file.
Resolve asset paths using the provided resolver.
Get the Vite "hot" file path.
Set the Vite "hot" file path.
Set the Vite build directory.
Use the given callback to resolve attributes for script tags.
Use the given callback to resolve attributes for style tags.
Use the given callback to resolve attributes for preload tags.
Generate Vite tags for an entrypoint.
Make tag for the given chunk.
Make a preload tag for the given chunk.
Resolve the attributes for the chunks generated script tag.
Resolve the attributes for the chunks generated stylesheet tag.
Resolve the attributes for the chunks generated preload tag.
deprecated
Generate an appropriate tag for the given URL in HMR mode.
deprecated
Generate a script tag for the given URL.
deprecated
Generate a stylesheet tag for the given URL in HMR mode.
Generate a script tag with attributes for the given URL.
Generate a link tag with attributes for the given URL.
Determine whether the given path is a CSS file.
Parse the attributes into key="value" strings.
Generate React refresh runtime script.
Get the path to a given asset when running in HMR mode.
Get the URL for an asset.
Get the content of a given asset.
Generate an asset path for the application.
Get the manifest file for the given build directory.
Get the path to the manifest file for the given build directory.
Get a unique hash representing the current manifest, or null if there is no manifest.
Get the chunk for the given entry point / asset.
Determine if the HMR server is running.
Get the Vite tag content as a string of HTML.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/11.x/Illuminate/Foundation/Vite.html