vue-cli-plugin-single-spa is an official plugin for Vue CLI that streamlines the process of integrating Vue applications into a single-spa microfrontend architecture. It automatically handles the necessary Webpack configuration and scaffolding to transform a standard Vue project into a single-spa microfrontend or parcel. The current stable version is 4.0.0, which notably shifted the default Webpack output module format to native ES modules. The project maintains a moderate release cadence, with consistent updates addressing Webpack compatibility, security, and feature enhancements. Its primary differentiator is its deep integration with the Vue CLI ecosystem, offering a simplified developer experience for creating single-spa compatible Vue applications without extensive manual Webpack configuration.
npm install vue-cli-plugin-single-spaVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to add the `single-spa` plugin to a Vue CLI project and shows the typical structure of the generated `main.ts` file, setting up the Vue application as a single-spa microfrontend.
To revert to UMD/SystemJS compatible output, add `pluginOptions['single-spa'].outputSystemJS: true` to your `vue.config.js` file.
To upgrade, run `vue add single-spa@3`. If issues persist, consult the `standalone-single-spa-webpack-plugin` documentation for version 3.
Ensure you are using `vue-cli-plugin-single-spa` v3.3.0 or higher when working with Webpack 5 to ensure proper compatibility and stability.
Refer to the plugin's GitHub releases or `package.json` for recommended Webpack versions. Upgrade or downgrade your `webpack` dependency accordingly, typically managed by Vue CLI.
Only install packages from trusted sources and consider using npm/yarn integrity checks or security scanning tools.
Add `pluginOptions['single-spa'].outputSystemJS: true` to your `vue.config.js` file to revert to UMD/SystemJS compatible output.
Ensure `single-spa` is correctly marked as a Webpack external. While the plugin handles this, custom Webpack configurations in `vue.config.js` might override it. Verify `webpack-chain` or `configureWebpack` modifications are not interfering.
Verify that your `main.js` (or entry file) exports the `bootstrap`, `mount`, and `unmount` functions returned by `singleSpaVue({})` and that `createApp` is correctly passed. Ensure `app.use()` calls for plugins like Vue Router or Vuex are inside the `handleInstance` callback.