Class ViteExtension

java.lang.Object
dev.relism.flash.ext.vite.ViteExtension
All Implemented Interfaces:
dev.relism.flash.extension.FlashExtension

public final class ViteExtension extends Object implements dev.relism.flash.extension.FlashExtension
A Vite frontend for a Flash app. In DEV it runs Vite's dev server beside the app, which the browser talks to and which proxies the backend's paths to Flash. Otherwise it serves the build that flash-ext-vite-maven-plugin packaged into the jar, as a single-page app.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Where the build lives on the classpath: the Maven plugin puts it there, production reads it from there.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    basePath(String basePath)
    Where the frontend is served from, / by default; Vite's base has to match it.
    void
    configure(dev.relism.flash.extension.FlashRegistrar<?> app, dev.relism.flash.extension.FlashContext ctx)
     
    devPort(int devPort)
    Vite's port in DEV, 5173 by default.
    navigationOnly(boolean navigationOnly)
    Whether only a browser navigation to a path that is no file gets index.html, true by default, so an API call to a missing route gets a 404 rather than the page.
    root(Path root)
    The Vite project, web (relative to the working directory) by default.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CLASSPATH

      public static final String CLASSPATH
      Where the build lives on the classpath: the Maven plugin puts it there, production reads it from there.
      See Also:
  • Constructor Details

    • ViteExtension

      public ViteExtension()
  • Method Details

    • root

      public ViteExtension root(Path root)
      The Vite project, web (relative to the working directory) by default. Read in DEV only.
    • devPort

      public ViteExtension devPort(int devPort)
      Vite's port in DEV, 5173 by default.
    • basePath

      public ViteExtension basePath(String basePath)
      Where the frontend is served from, / by default; Vite's base has to match it.
    • configure

      public void configure(dev.relism.flash.extension.FlashRegistrar<?> app, dev.relism.flash.extension.FlashContext ctx)
      Specified by:
      configure in interface dev.relism.flash.extension.FlashExtension