question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpack-bundle-analyzer in vite.config.js

See original GitHub issue

Describe the bug

How can I use webpack-bundle-analyzer in vite.config.js ?

I tried to configure it in this way

const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = {
    plugins: [
        new BundleAnalyzerPlugin()
    ]
}

but no file is created

thanks

System Info

  • required vite version: 1.0.0-rc.1
  • required Operating System: macos 10.15.7
  • required Node version: v14.8.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
opop007commented, Apr 12, 2021

u can use rollup-plugin-visualizer instead https://github.com/btd/rollup-plugin-visualizer

2reactions
qnpcommented, Apr 6, 2021

For Vite 2:

import analyze from 'rollup-plugin-analyzer'

export default {
  build: {
    rollupOptions: {
      plugins: [analyze()],
    },
  },
}

However @thekevinbrown, did you manage to port webpack-bundle-analyser into a vite plugin ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

vite-plugin-bundle-analyzer - npm
Start using vite-plugin-bundle-analyzer in your project by running `npm i vite-plugin-bundle-analyzer`. There are no other projects in the ...
Read more >
Configuring Vite
When running vite from the command line, Vite will automatically try to resolve a config file named vite.config.js inside project root.
Read more >
vite-bundle-visualizer - NPM Package Overview - Socket.dev
Start using Socket to analyze vite-bundle-visualizer and its 2 dependencies to ... Visualize vite bundle, like webpack-bundle-analyzer.
Read more >
How Does Vite Work - A Comparison to webpack - Harlan Wilton
js and app.js . On inspecting them you'd see a lot of gibberish looking code. it helps to use the webpack-bundle-analyzer to see...
Read more >
6 Tools and Techniques to Analyze Webpack Bundle Size
Webpack Visualizer is an analysis tool that allows you to inspect and visualize Webpack bundles. For example, it can detect which modules are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found