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.
|
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, writeStreampublic 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)
AbstractDevServerRunnergetServerStartupCommand in class AbstractDevServerRunnernodeExec - the path to the node binaryprotected String getServerName()
AbstractDevServerRunnergetServerName in class AbstractDevServerRunnerprotected File getServerBinary()
AbstractDevServerRunnergetServerBinary in class AbstractDevServerRunnerprotected File getServerConfig()
AbstractDevServerRunnergetServerConfig in class AbstractDevServerRunnerprotected Pattern getServerFailurePattern()
AbstractDevServerRunnergetServerFailurePattern in class AbstractDevServerRunnerprotected Pattern getServerSuccessPattern()
AbstractDevServerRunnergetServerSuccessPattern in class AbstractDevServerRunnerpublic HttpURLConnection prepareConnection(String path, String method) throws IOException
DevModeHandlerprepareConnection in interface DevModeHandlerprepareConnection in class AbstractDevServerRunnerpath - the file to request, needs to be safemethod - the http method to useIOException - on connection errorCopyright © 2021. All rights reserved.