ViteWatch
class System\Console\Asset\Vite\ViteWatch
extends System\Console\Asset\Vite\ViteCompile
implements
Symfony\Component\Console\Command\SignalableCommandInterface
Extends
Class | Description |
---|---|
ViteCompile
|
Traits
Trait | Description |
---|---|
HandlesCleanup
|
Console Command Trait that injects cross-platform signal handling to trigger cleanup on exit through the handleCleanup() method on the implementing class. |
ProvidesAutocompletion
|
Console Command Trait that injects cross-platform signal handling to trigger cleanup on exit through the handleCleanup() method on the implementing class. |
Properties
protected
static
$defaultName
:
string
|
null
= "vite:watch"
The default command name for lazy loading.
protected
$description
:
string
= "Vite and compile assets on-the-fly as changes are made."
The console command description.
protected
$replaces
:
array
= ["vite:dev"]
List of commands that this command replaces (aliases)
protected
$signature
:
string
= "vite:watch\n {package : Defines the package to watch for changes}\n {viteArgs?* : Arguments to pass through to the Webpack CLI}\n {--f|production : Runs compilation in \"production\" mode}\n {--m|manifest= : Defines package.json to use for compile}\n {--s|silent : Silent mode}\n {--d|disable-tty : Disable tty mode}\n {--no-progress : Do not show mix progress}"
The name and signature of this command.
inherited
protected
$configFile
:
string
= "vite.config.mjs"
Name of config file i.e. mix.webpack.js, vite.config.js
inherited protected $laravel : Winter\Storm\Foundation\Application
inherited protected $packageJson : System\Classes\Asset\PackageJson
PackageJson object holding the contents of the active package.json
inherited protected $watchingFilePath : string
File path being watched, used for cleanup by mix:watch
Methods
public handle () : integer
Call the AssetCompile::watchHandle with the vite type
public handleCleanup () : void
Handle the cleanup of this command if a termination signal is received
protected beforeExecution (string $configPath) : void
Create the public dir if required
Property | Type | Description |
---|---|---|
$configPath | string |
string
|
protected createCommand (string $configPath) : array
Create the command array to create a Process object with
Property | Type | Description |
---|---|---|
$configPath | string |
string
|
inherited public __construct ()
Create a new command instance.
inherited
public
alert (string $string, int | string | null $verbosity = null
)
: void
Write a string in an alert box.
Property | Type | Description |
---|---|---|
$string | string |
string
|
$verbosity | int | string | null |
int | string | null
|
inherited public compileHandle (string $type) : integer
Property | Type | Description |
---|---|---|
$type | string |
string
|
inherited public complete (Symfony\Component\Console\Completion\CompletionInput $input, Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
Provide autocompletion for this command's input
Property | Type | Description |
---|---|---|
$input | Symfony\Component\Console\Completion\CompletionInput |
Symfony\Component\Console\Completion\CompletionInput
|
$suggestions | Symfony\Component\Console\Completion\CompletionSuggestions |
Symfony\Component\Console\Completion\CompletionSuggestions
|
inherited
public
error (string $string, int | string | null $verbosity = null
)
: void
Write a string as error output.
Property | Type | Description |
---|---|---|
$string | string |
string
|
$verbosity | int | string | null |
int | string | null
|
inherited public getSubscribedSignals () : array
Returns the process signals this command listens to
inherited public handleSignal (integer $signal) : void
Handle the provided Unix process signal
Property | Type | Description |
---|---|---|
$signal | integer |
integer
|
inherited public handleWindowsSignal (integer $event) : void
Handle the provided Windows process singal.
Property | Type | Description |
---|---|---|
$event | integer |
integer
|
inherited public watchHandle (string $type) : integer
Property | Type | Description |
---|---|---|
$type | string |
string
|
inherited protected afterExecution (string $configPath) : void
Ran after dispatching the compile process, use for tearing down
Property | Type | Description |
---|---|---|
$configPath | string |
string
|
inherited protected executeProcess (string $configPath) : integer
Run the mix command against the provided package
Property | Type | Description |
---|---|---|
$configPath | string |
string
|
inherited protected getJsConfigPath (string $path) : string
Get the path to the mix.webpack.js file for the provided winter.mix.js file
Property | Type | Description |
---|---|---|
$path | string |
string
|
inherited protected getNpmPackageManifest () : System\Classes\Asset\PackageJson
Read the package.json file for the project, path configurable with the
--manifest
option
inherited protected getPackagePath (string $path) : string
Get the package path for the provided winter.mix.js file
Property | Type | Description |
---|---|---|
$path | string |
string
|
inherited protected isPackageWithinWorkspace (string $mixJsPath) : bool
Check if Mix is able to compile the provided winter.mix.js file
Property | Type | Description |
---|---|---|
$mixJsPath | string |
string
|