Class TaskUpdateSettingsFile

java.lang.Object
com.vaadin.flow.server.frontend.TaskUpdateSettingsFile
All Implemented Interfaces:
FallibleCommand, Serializable

public class TaskUpdateSettingsFile extends Object implements FallibleCommand, Serializable
Creates a vaadin-dev-server-settings.json file for use with dev server configuration.

For internal use only. May be renamed or removed in a future release.

Since:
9.0
See Also:
  • Field Details

  • Method Details

    • execute

      public void execute()
      Description copied from interface: FallibleCommand
      Runs the given command.

      If execution fails then the command may throw an exception which may give a message and a cause of the failure.

      Specified by:
      execute in interface FallibleCommand
    • getOfflinePath

      public static String getOfflinePath(com.vaadin.flow.server.PwaConfiguration pwaConfiguration, File npmFolder)
      Computes the value for the OFFLINE_PATH constant that Vite compiles into the service worker.

      Vite substitutes the value verbatim, so the path is wrapped in single quotes to make it a JavaScript expression. Bundle validation compares this value against the one recorded in the bundle's stats.json, so both sides must derive it from this method.

      For internal use only. May be renamed or removed in a future release.

      Parameters:
      pwaConfiguration - the PWA configuration of the application, not null
      npmFolder - the project root, used to relativize an absolute offline path
      Returns:
      the offline path wrapped in single quotes