@esmx/rspack-vue
@esmx/rspack-vue provides a set of APIs for creating and configuring Vue-based Rspack applications, supporting Vue 2.7+ and Vue 3 component development, building, and SSR.
Installation
Use package manager to install @esmx/rspack-vue as a development dependency:
Type Exports
RspackVueAppOptions
Vue application configuration options interface, inherits from @esmx/rspack's RspackHtmlAppOptions:
vueLoader: vue-loader configuration options
For details on base types, please refer to the @esmx/rspack documentation.
Function Exports
createRspackVue2App
Creates a Vue 2.7+ application build instance. Automatically configures vue-loader-v15 and Vue 2 related compilation options.
Parameters:
esmx: Esmx framework instanceoptions: Vue application configuration options
Returns:
- Returns a
Promisethat resolves to the created application instance
createRspackVue3App
Creates a Vue 3 application build instance. Automatically configures vue-loader-v17 and Vue 3 related compilation options.
Parameters:
esmx: Esmx framework instanceoptions: Vue application configuration options
Returns:
- Returns a
Promisethat resolves to the created application instance
Constant Exports
RSPACK_LOADER
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 files
Using these constants can reference built-in loaders in configuration, avoiding manual string input:
Notes:
- These loaders are already built into Rspack, requiring no additional installation
- When customizing loader configuration, these constants can be used to replace default loader implementations
- Some loaders (such as
builtinSwcLoader) have specific configuration options; please refer to the corresponding configuration documentation
Module Exports
rspack
Re-exports all contents from @rspack/core package, providing complete Rspack core functionality.