The Rspack Vue package provides a set of APIs for creating and configuring Vue-based Rspack applications, supporting Vue component development, building, and Server-Side Rendering.
Use package manager to install @esmx/rspack-vue as a development dependency:
Build target environment type that defines the target environment for application builds, used to configure specific optimizations and features in the build process:
node: Build code to run in Node.js environmentclient: Build code to run in browser environmentserver: Build code to run in server environmentRspack application configuration context interface provides context information accessible in configuration hook functions:
esmx: Esmx framework instancebuildTarget: Current build target (client/server/node)config: Rspack configuration objectoptions: Application configuration optionsRspack application configuration options interface:
css: CSS output method, optional 'css' (separate file) or 'js' (bundled into JS), defaults to automatic selection based on environment: production uses 'css' to optimize caching and parallel loading, development uses 'js' to support HMRloaders: Custom loader configurationstyleLoader: style-loader configuration optionscssLoader: css-loader configuration optionstarget: Build target compatibility configurationdefinePlugin: Global constant definitionsconfig: Configuration hook functionInherits from RspackAppOptions, used to configure specific options for HTML applications.
Creates a standard Rspack application instance.
Parameters:
esmx: Esmx framework instanceoptions: Rspack application configuration optionsReturns:
Creates an HTML-type Rspack application instance.
Parameters:
esmx: Esmx framework instanceoptions: HTML application configuration optionsReturns:
Rspack built-in loader identifier mapping object that provides commonly used loader name constants:
builtinSwcLoader: Rspack built-in SWC loader for processing TypeScript/JavaScript fileslightningcssLoader: Rspack built-in lightningcss loader, a high-performance compiler for processing CSS filesstyleLoader: Loader that injects CSS into the DOMcssLoader: Loader that parses CSS files and handles CSS modularizationlessLoader: Loader that compiles Less files to CSSstyleResourcesLoader: Loader that automatically imports global style resources (variables, mixins, etc.)workerRspackLoader: Loader for processing Web Worker filesUsing these constants can reference built-in loaders in configuration, avoiding manual string input:
Notes:
builtinSwcLoader) have specific configuration options; please refer to the corresponding configuration documentationRe-exports all contents from @rspack/core package, providing complete Rspack core functionality.