{"id":22797,"library":"vite-plugin-qiankun-lite","title":"vite-plugin-qiankun-lite","description":"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.","status":"active","version":"1.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/kotarella1110/vite-plugin-qiankun-lite","tags":["javascript","qiankun","micro frontend","microfrontend","micro frontends","microfrontends","micro-frontend","micro-frontends","microservice","typescript"],"install":[{"cmd":"npm install vite-plugin-qiankun-lite","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-qiankun-lite","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-qiankun-lite","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin requires Vite >=4 <8","package":"vite","optional":false}],"imports":[{"note":"Default export only; named import will result in undefined.","wrong":"import { qiankun } from 'vite-plugin-qiankun-lite'","symbol":"default","correct":"import qiankun from 'vite-plugin-qiankun-lite'"},{"note":"TypeScript type export; does not exist at runtime.","wrong":"import { VitePluginQiankunLiteOptions } from 'vite-plugin-qiankun-lite'","symbol":"VitePluginQiankunLiteOptions","correct":"import type { VitePluginQiankunLiteOptions } from 'vite-plugin-qiankun-lite'"},{"note":"CommonJS usage is supported; but ESM is recommended for Vite projects.","wrong":"","symbol":"require","correct":"const qiankun = require('vite-plugin-qiankun-lite')"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport qiankun from 'vite-plugin-qiankun-lite';\n\nexport default defineConfig({\n  plugins: [\n    react(),\n    qiankun({\n      name: 'my-sub-app',\n      sandbox: true, // experimental: enable JS sandbox\n    }),\n  ],\n  server: {\n    port: 3001,\n    origin: 'http://localhost:3001', // must match the registered app URL\n  },\n});","lang":"typescript","description":"Configures a Vite sub-application with the qiankun plugin, enabling micro-frontend integration with sandbox and HMR."},"warnings":[{"fix":"Set sandbox: false or test thoroughly with sandbox enabled.","message":"The sandbox option is experimental. In sandbox mode, plugins that rely on global variables (e.g., window, document) may not work as expected.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Disable sandbox if such issues occur, or update the library to use the proxy window (qiankunWindow) manually.","message":"The 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.","severity":"gotcha","affected_versions":">=1.0.3"},{"fix":"Refer to qiankun documentation for manual lifecycle hook registration; this plugin handles them automatically.","message":"Plugin does not export lifecycle hooks like exportLifeCycleHooks. Do not expect named exports such as qiankunWindow or hooks.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Upgrade Vite to version 4, 5, 6, or 7.","message":"Usage with Vite 3 is not supported; peer dependency requires Vite >=4.","severity":"deprecated","affected_versions":">=1.3.0"},{"fix":"Disable sandbox during development if HMR issues arise.","message":"HMR may not work correctly when sandbox is enabled due to proxy re-initialization.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use default import: import qiankun from 'vite-plugin-qiankun-lite'","cause":"Importing the plugin using named import instead of default import.","error":"TypeError: qiankun is not a function"},{"fix":"Remove the import of VitePluginQiankunLiteOptions or use import type.","cause":"Trying to import the TypeScript type as a runtime value in a JavaScript file.","error":"Error: [vite] RollupError: \"VitePluginQiankunLiteOptions\" is not exported by \"node_modules/vite-plugin-qiankun-lite/dist/index.mjs\""},{"fix":"Use window directly or refer to qiankun documentation for the proxy window.","cause":"Attempting to use qiankunWindow from vite-plugin-qiankun-lite; the plugin does not export it.","error":"ReferenceError: qiankunWindow is not defined"},{"fix":"Upgrade Vite to version 4, 5, 6, or 7.","cause":"Using an unsupported version of Vite.","error":"Error: The plugin requires Vite >=4.0.0. Current version: 3.x.x"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}