public final class ViteHandler extends AbstractDevServerRunner
This class is meant to be used during developing time.
For internal use only. May be renamed or removed in a future release.
Modifier and Type | Field and Description |
---|---|
static String |
VITE_SERVER
The local installation path of the server node script.
|
Constructor and Description |
---|
ViteHandler(Lookup lookup,
int runningPort,
File npmFolder,
CompletableFuture<Void> waitFor)
Creates and starts the dev mode handler if none has been started yet.
|
Modifier and Type | Method and Description |
---|---|
protected File |
getServerBinary()
Gets the binary that starts the dev server.
|
protected File |
getServerConfig()
Gets the main configuration file for the dev server.
|
protected Pattern |
getServerFailurePattern()
Gets a pattern to match with the output to determine that the server has
failed to start.
|
protected String |
getServerName()
Gets the name of the dev server for outputting to the user and
statistics.
|
protected List<String> |
getServerStartupCommand(String nodeExec)
Gets the commands to run to start the dev server.
|
protected Pattern |
getServerSuccessPattern()
Gets a pattern to match with the output to determine that the server has
started successfully.
|
HttpURLConnection |
prepareConnection(String path,
String method)
Prepare a HTTP connection against the dev server.
|
checkConnection, doStartDevServer, getApplicationConfiguration, getFailedOutput, getPort, getProjectRoot, getWatchDog, handleRequest, onDevServerCompilation, serveDevModeRequest, stop, triggerLiveReload, updateServerStartupEnvironment, validateFiles, waitForDevServer, writeStream
public static final String VITE_SERVER
public ViteHandler(Lookup lookup, int runningPort, File npmFolder, CompletableFuture<Void> waitFor)
lookup
- the provided lookup to get required datarunningPort
- a port on which Vite is already running or 0 to start a new
processnpmFolder
- folder with npm configuration fileswaitFor
- a completable future whose execution result needs to be
available to start the dev serverprotected List<String> getServerStartupCommand(String nodeExec)
AbstractDevServerRunner
getServerStartupCommand
in class AbstractDevServerRunner
nodeExec
- the path to the node binaryprotected String getServerName()
AbstractDevServerRunner
getServerName
in class AbstractDevServerRunner
protected File getServerBinary()
AbstractDevServerRunner
getServerBinary
in class AbstractDevServerRunner
protected File getServerConfig()
AbstractDevServerRunner
getServerConfig
in class AbstractDevServerRunner
protected Pattern getServerFailurePattern()
AbstractDevServerRunner
getServerFailurePattern
in class AbstractDevServerRunner
protected Pattern getServerSuccessPattern()
AbstractDevServerRunner
getServerSuccessPattern
in class AbstractDevServerRunner
public HttpURLConnection prepareConnection(String path, String method) throws IOException
DevModeHandler
prepareConnection
in interface DevModeHandler
prepareConnection
in class AbstractDevServerRunner
path
- the file to request, needs to be safemethod
- the http method to useIOException
- on connection errorCopyright © 2022. All rights reserved.