Registry / web-framework / vite-plugin-qiankun-lite

vite-plugin-qiankun-lite

JSON →
library1.3.0jsnpmunverified

vite-plugin-qiankun-lite is a Vite plugin that simplifies integrating qiankun micro-frontend framework into Vite-based applications. Version 1.3.0 supports Vite 4 through 7, maintaining active development with regular releases. Unlike alternatives, it requires no lifecycle function exports or special proxy window imports; just add the plugin. It preserves ES module benefits, provides an experimental JS sandbox, and supports React HMR. The plugin is TypeScript-friendly with bundled type definitions.

npm install vite-plugin-qiankun-lite
INSTALL
IMPORT
SIG · VITE-PLUGIN-QIANKU
V
vite-plugin-qiankun-lite
web-frameworkjavascriptv1.3.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import qiankun from 'vite-plugin-qiankun-lite'
import { qiankun } from 'vite-plugin-qiankun-lite'
Default export only; named import will result in undefined.
VitePluginQiankunLiteOptions
import type { VitePluginQiankunLiteOptions } from 'vite-plugin-qiankun-lite'
import { VitePluginQiankunLiteOptions } from 'vite-plugin-qiankun-lite'
TypeScript type export; does not exist at runtime.
require
const qiankun = require('vite-plugin-qiankun-lite')
CommonJS usage is supported; but ESM is recommended for Vite projects.

Configures a Vite sub-application with the qiankun plugin, enabling micro-frontend integration with sandbox and HMR.

// vite.config.ts import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import qiankun from 'vite-plugin-qiankun-lite'; export default defineConfig({ plugins: [ react(), qiankun({ name: 'my-sub-app', sandbox: true, // experimental: enable JS sandbox }), ], server: { port: 3001, origin: 'http://localhost:3001', // must match the registered app URL }, });
Debug
Known issues
gotchaThe sandbox option is experimental. In sandbox mode, plugins that rely on global variables (e.g., window, document) may not work as expected.
fix
Set sandbox: false or test thoroughly with sandbox enabled.
affects: >=1.0.0
gotchaThe plugin automatically prefixes global browser variables (e.g., window, document) when sandbox is enabled. This may break libraries that use dynamic property access on window.
fix
Disable sandbox if such issues occur, or update the library to use the proxy window (qiankunWindow) manually.
affects: >=1.0.3
breakingPlugin does not export lifecycle hooks like exportLifeCycleHooks. Do not expect named exports such as qiankunWindow or hooks.
fix
Refer to qiankun documentation for manual lifecycle hook registration; this plugin handles them automatically.
affects: >=1.0.0
deprecatedUsage with Vite 3 is not supported; peer dependency requires Vite >=4.
fix
Upgrade Vite to version 4, 5, 6, or 7.
affects: >=1.3.0
gotchaHMR may not work correctly when sandbox is enabled due to proxy re-initialization.
fix
Disable sandbox during development if HMR issues arise.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: qiankun is not a function
Importing the plugin using named import instead of default import.
fix
Use default import: import qiankun from 'vite-plugin-qiankun-lite'
Error: [vite] RollupError: "VitePluginQiankunLiteOptions" is not exported by "node_modules/vite-plugin-qiankun-lite/dist/index.mjs"
Trying to import the TypeScript type as a runtime value in a JavaScript file.
fix
Remove the import of VitePluginQiankunLiteOptions or use import type.
ReferenceError: qiankunWindow is not defined
Attempting to use qiankunWindow from vite-plugin-qiankun-lite; the plugin does not export it.
fix
Use window directly or refer to qiankun documentation for the proxy window.
Error: The plugin requires Vite >=4.0.0. Current version: 3.x.x
Using an unsupported version of Vite.
fix
Upgrade Vite to version 4, 5, 6, or 7.
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies
viterequiredpeer dependency; plugin requires Vite >=4 <8
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
vite-plugin-qiankun-lite — npm install vite-plugin-qiankun-lite · libregistry