It is an universal plugin for bundle visualizer, which can be used with vite/webpack/rollup, powered by source-map-explorer
pnpm i unplugin-visualizer
Vite
// vite.config.ts
import unpluginVisualizer from 'unplugin-visualizer/vite'
export default defineConfig({
plugins: [
unpluginVisualizer({ /* options */ }),
],
})
Example: playground/
Rollup
// rollup.config.js
import unpluginVisualizer from 'unplugin-visualizer/rollup'
export default {
plugins: [
unpluginVisualizer({ /* options */ }),
],
}
Webpack
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-visualizer/webpack')({ /* options */ }),
],
}
Nuxt
// nuxt.config.js
export default {
buildModules: [
['unplugin-isualizer/nuxt', { /* options */ }],
],
}
This module works for both Nuxt 2 and Nuxt Vite
Vue CLI
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-visualizer/webpack')({ /* options */ }),
],
},
}