GithubHelp home page GithubHelp logo

nonzzz / vite-bundle-analyzer Goto Github PK

View Code? Open in Web Editor NEW
87.0 2.0 3.0 8.29 MB

bundle analyzer for vite

License: MIT License

JavaScript 0.19% TypeScript 97.82% HTML 1.99%
bundle-analyzer rollup-plugin vite-plugin

vite-bundle-analyzer's Introduction

Hi there ๐Ÿ‘‹

  • You can call me Kanno
  • I've been busy recently
  • Learning zig

vite-bundle-analyzer's People

Contributors

a3mitskevich avatar mengdaoshizhongxinyang avatar n0099 avatar nonzzz avatar paulcarroll avatar tsmota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vite-bundle-analyzer's Issues

Module sizes

Currently all npm packages have same size in UI, while some may be 10kb and others 1mb. Can you please make modules size based on their size in bundle? It works like that in webpack-bundle-analyzer

Output file is empty (with solution)

On my M1 macbook pro the output file is completely empty, 0 bytes

My setup/project:

  • M1 macbook pro (32gb ram)
  • Nx repo
  • Vite
  • Analyser running in 'static' mode

I found the problem was not awaiting the write of the output file and have included a fix here: #21

Invalidate Option `analyzerMode` ๆ‰“ๅŒ…ๆŠฅ้”™

ๆœ€ๆ–ฐ็‰ˆ
analyzer({
openAnalyzer: false, // ๆ˜ฏๅฆๆ‰“ๅผ€้™ๆ€็ฝ‘็ซ™
}),
ๅช้…็ฝฎไบ†ไธ€ไธชๅ‚ๆ•ฐ
"devDependencies": {
"@vitejs/plugin-legacy": "^5.3.2",
"@vitejs/plugin-vue": "^5.0.4",
"rollup-plugin-visualizer": "^5.12.0",
"unplugin-auto-import": "^0.17.5",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.2.9",
"vite-bundle-analyzer": "^0.9.4",
"vite-plugin-compression2": "^1.1.0"
}

Crash on build

I can't get it to work on a freshly created SvelteKit project.
Excuse me if it's just a knowledge gap and I am missing what this project is actually for.

Steps to reproduce:

  1. npm create svelte@latest my-app
  2. add vite-bundle-analyzer to vite.config.ts
  3. npm run build
error during build:
TypeError: Cannot read properties of null (reading 'port')
    at get port [as port] (file:///Users/peter/code/local-first/vite-bundle-test/node_modules/.pnpm/[email protected]/node_modules/vite-bundle-analyzer/dist/index.mjs:2:7940)
    at Object.closeBundle (file:///Users/peter/code/local-first/vite-bundle-test/node_modules/.pnpm/[email protected]/node_modules/vite-bundle-analyzer/dist/index.mjs:2:10477)
    at file:///Users/peter/code/local-first/vite-bundle-test/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19778:40
    at async Promise.all (index 0)
    at async PluginDriver.hookParallel (file:///Users/peter/code/local-first/vite-bundle-test/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19706:9)
    at async Object.close (file:///Users/peter/code/local-first/vite-bundle-test/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:20635:13)
    at async build (file:///Users/peter/code/local-first/vite-bundle-test/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-cNe07EU9.js:67497:13)
    at async CAC.<anonymous> (file:///Users/peter/code/local-first/vite-bundle-test/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/cli.js:842:9)

You can also check out the codesandbox or the minimal repo showcasing the error.

Feature possiblity: add stdout option to analyzerMode

Not sure if you're open to requests, but I'm mainly looking for a decent summary of the build output in the terminal. This makes most sense on a build server as well because the final build does not need to have a fancy result. Something like the following is more than enough: 16 chunks of 876 kB (parsed: 432 kB | gzipped: 123 kB)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.