The Rspack Vue package provides APIs to create and configure Rspack apps based on Vue, supporting component development, builds, and server-side rendering.
Install @esmx/rspack-vue as a dev dependency:
Target environment type used to configure build-specific optimizations:
node: code for Node.js runtimeclient: code for browsersserver: code for server runtimesContext available within configuration hooks:
esmx: Esmx instancebuildTarget: current target (client/server/node)config: Rspack configuration objectoptions: app optionsOptions for Rspack apps:
css: output mode ('css' for separate files, 'js' inline). Defaults to 'css' in production; 'js' in development for HMRloaders: custom loader configurationstyleLoader: options for style-loadercssLoader: options for css-loadertarget: compatibility targetsdefinePlugin: global constant definitionsconfig: configuration hookExtends RspackAppOptions with HTML-app specific options.
Creates a standard Rspack app instance.
Parameters:
esmx: Esmx instanceoptions: Rspack app optionsReturns:
Promise<App> resolving to the created appCreates an HTML-type Rspack app instance.
Parameters:
esmx: Esmx instanceoptions: HTML app optionsReturns:
Promise<App> resolving to the created appLoader identifier map for commonly used loaders:
builtinSwcLoader: SWC loader for TS/JS fileslightningcssLoader: high-performance CSS compilerstyleLoader: injects CSS into the DOMcssLoader: parses CSS and handles CSS moduleslessLoader: compiles Less to CSSstyleResourcesLoader: auto-imports global style resources (variables, mixins)workerRspackLoader: handles Web Worker filesExample:
Re-exports everything from @rspack/core to provide full Rspack capabilities.