@vizejs/unplugin
@vizejs/unplugin
Experimental unplugin-based Vue SFC integration powered by Vize.
[!WARNING]
@vizejs/unpluginis still unstable.@vizejs/vite-pluginremains the recommended and best-tested bundler integration today.
@vizejs/unplugin provides experimental support for:
rolluprolldownwebpackesbuildbabel
Rspack intentionally uses the dedicated @vizejs/rspack-plugin path instead of an unplugin export because its loader chain, experiments.css, and HMR behavior need Rspack-specific handling.
Installation
Install vp once from the Vite+ install guide, then add the package:
vp install @vizejs/unplugin
Usage
rollup
import vize from "@vizejs/unplugin/rollup";
export default {
plugins: [vize()],
};
webpack
import Vize from "@vizejs/unplugin/webpack";
export default {
plugins: [Vize()],
};
Webpack 5 is detected through compiler.webpack. Webpack 4 is supported by resolving
DefinePlugin from the host project's webpack package:
import Vize from "@vizejs/unplugin/webpack";
export default {
plugins: [
Vize({
compatibility: {
webpackVersion: 4,
},
}),
],
};
For Vue 0.11, Vue 1, Vue 2, or Nuxt 2 projects that already use the legacy
Vue/Webpack compiler chain, keep Vize non-invasive and let the host compiler
handle .vue files:
Vize({
compatibility: {
vueVersion: 2,
webpackVersion: 4,
},
});
rolldown
import vize from "@vizejs/unplugin/rolldown";
export default {
plugins: [vize()],
};
esbuild
import { build } from "esbuild";
import vize from "@vizejs/unplugin/esbuild";
await build({
entryPoints: ["src/main.ts"],
bundle: true,
plugins: [vize()],
});
babel
import vize from "@vizejs/unplugin/babel";
export default {
plugins: [vize()],
};
The Babel adapter compiles .vue files before Babel parses them. Keep your usual Babel
TypeScript/JSX transforms in the pipeline if your SFC scripts use those syntaxes.
Caveats
- Vite is still the recommended integration if you need the most complete behavior today.
- CSS Modules and preprocessors depend on the host bundler CSS pipeline and are more likely to change than the Vite path.
- Scoped preprocessor styles are compiled before they are scoped, as in Vue: Webpack uses your
.scss/.less/.stylrules, while Rollup, Rolldown and esbuild run the project's installedsass(orsass-embedded),lessorstylus. - If your bundler inlines the Vue runtime, Vize injects the usual Vue 3 compile-time feature flags for Rollup-like and Webpack hosts when its compiler is active.
- Test carefully before depending on this package in production.
Related Packages
Import Element Plus on demand. Support Vite, Webpack, Vue CLI, Rollup and esbuil...
Lightning CSS integration for Vite, Rollup, esbuild, Webpack, Vue CLI, and more.
Version History
| Version | Released | License |
|---|---|---|
| 0.519.0 | MIT | |
| 0.518.0 | MIT | |
| 0.517.0 | MIT | |
| 0.516.0 | MIT | |
| 0.515.0 | MIT | |
| 0.514.0 | MIT | |
| 0.513.0 | MIT | |
| 0.512.0 | MIT | |
| 0.511.0 | MIT | |
| 0.510.0 | MIT | |
| 0.509.0 | MIT | |
| 0.508.0 | MIT | |
| 0.507.0 | MIT | |
| 0.506.0 | MIT | |
| 0.504.0 | MIT | |
| 0.503.0 | MIT | |
| 0.502.0 | MIT | |
| 0.501.0 | MIT | |
| 0.500.0 | MIT | |
| 0.499.0 | MIT | |
| 0.498.0 | MIT | |
| 0.497.0 | MIT | |
| 0.496.0 | MIT | |
| 0.495.0 | MIT | |
| 0.494.0 | MIT | |
| 0.493.0 | MIT | |
| 0.492.0 | MIT | |
| 0.491.0 | MIT | |
| 0.490.0 | MIT | |
| 0.489.0 | MIT |
Showing the latest 30 of 391. See every release on npm