The Rspack Vue package provides a set of APIs for creating and configuring Rspack applications based on the Vue framework, supporting Vue component development, building, and server-side rendering.
Install @esmx/rspack-vue as a development dependency using your package manager:
Build target environment type, defining the target environment for application building, used to configure specific optimizations and features during the build process:
node: Build code for Node.js environmentclient: Build code for browser environmentserver: Build code for server environmentRspack application configuration context interface, providing contextual 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, either 'css' (standalone file) or 'js' (bundled into JS), defaults to automatic selection based on environment: production uses 'css' for cache and parallel loading optimization, development uses 'js' for HMR supportloaders: Custom loader configurationsstyleLoader: style-loader configuration optionscssLoader: css-loader configuration optionstarget: Build target compatibility configurationdefinePlugin: Global constant definitionsconfig: Configuration hook functionExtends 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:
Mapping object of Rspack built-in loader identifiers, providing 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 CSS filesstyleLoader: Loader for injecting CSS into the DOMcssLoader: Loader for parsing CSS files and handling CSS modularizationlessLoader: Loader for compiling Less files into CSSstyleResourcesLoader: Loader for automatically importing global style resources (e.g., variables, mixins)workerRspackLoader: Loader for processing Web Worker filesUsing these constants allows referencing built-in loaders in configurations, avoiding manual string input:
Notes:
builtinSwcLoader) have specific configuration options—refer to the respective documentationRe-exports all contents from the @rspack/core package, providing complete Rspack core functionality.